1821826 Members
3466 Online
109638 Solutions
New Discussion юеВ

Re: mysql error

 
SOLVED
Go to solution
Kyle D. Harris
Regular Advisor

mysql error

I apparently have installed mysql 4.0.17 and i started 'mysqld_safe' ... I check my processes and it indeed shows up.

When i do mysqladmin -h localhost version, i get a :

"mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using Password: NO)'

Anybody come across this or know any solutions what my problem might be? I have to leave soon but i'll be in tomorrow morning. Thanks for any replies.

PS. i have RH 9.0 and installed the RPM's
5 REPLIES 5
Bruce Copeland
Trusted Contributor
Solution

Re: mysql error

Kyle:

It basically wants a password before it will allow access to root. MySQL treats root like any other user, and requires a password unless you set it up otherwise. Try

mysqladmin -h localhost version -p

and it will prompt you for a password, which should then give you access.

Bruce
Martin P.J. Zinser
Honored Contributor

Re: mysql error

Hello Kyle,

you should have a file Docs/manual.html somewhere in your mysql installation. Section 4.3 discusses user setup and management in detail. If you have not done so make sure the myqsl server is <> running as root.

Greetings, Martin
Philip Lo
Occasional Contributor

Re: mysql error

login to mysql using 'mysql -u root' and try allocating permission for root@localhost to login by either [update mysql.user set host='localhost' where user='root'] or adding another privilege for root@localhost.
Claudio Cilloni
Honored Contributor

Re: mysql error

the string '(Using Password: NO)' make me think that you haven't provided a password but mysql wants it. Add the -p option to mysqladmin, and it should ask you a password before trying to connect.

usually, after installing mysql, I add a user called 'admin' or 'system' (like Oracle) with administrative privileges and I use this to maintain the server (even from remote machines):

# mysql (from root)
mysql> use mysql
Database changed
mysql> grant all privileges on *.* to admin@"%" identified by 'admin';


now, from remote machines, I can connect to mysql server with:

$ mysql -h -u admin -p

hth,
Claudio
Paul Cross_1
Respected Contributor

Re: mysql error

The mysql distribution usually comes with a subdirectory called "scripts" there are some important setup scripts that need to be run before logging in (this of course depends on how you installed mysql). mysql_install_db.sh sets up the priviledge tables, without them no password will work anyway.