# Help - can't change root MySQL password



## bunner bob (Jan 11, 2004)

I'm trying to change the password I set up for my root MySQL user. What I've read says the syntax is: 

 shell > mysqladmin -u root old_password new_password 

 but I keep getting the error: 
 'Access denied for user: 'root@localhost' (Using password: NO)' 

 So I must not be typing something right. 

 The (old) password is working in other situations - PHPmyAdmin for example is connecting properly to MySQL. 

I also tried installing the preference pane from the complete mysql installer, but I can't get it to activate. I installed MySQL directly from the MySQL site, so the version number is newer than the MySQL included with complete MySQL - probably the reason. Anyway, I should be able to change the password with the above command - right?

 I'm running Mac OS X Panther (10.3.2), mysql 4.0.17 

 Thanks, 
 Bob


----------



## podmate (Jan 12, 2004)

< snip >
mysqladmin -u root old_password new_password
< /snip >

You syntax is slightly off.  Here is the correct syntax:

mysqladmin -u root -p password new_password (password is telling mysql that you want to reset the password for the given user - root in this case - , password is not your old password, and new_password is the new password you want to use)

after entering :
mysqladmin -u root -p password new_password
you will be prompted to enter you "old" root password.  
You password has now been changed.


----------



## Matsaki (Nov 14, 2004)

And if fore some strange reason I dont know the old password  Just installed mySQL and I don't get access as there is a password set that I don't know?


----------



## bunner bob (Nov 14, 2004)

Should be no password set unless you set it. By default mysql is un-passworded. If I'm not mistaken.

- Bob


----------



## michaelsanford (Nov 15, 2004)

You say phpMyAdmin works ? Look in config.inc.php and see what password is used there. If it's blank, try connecting to MySQL with a blank root password:
 $ mysql -u root -p
 Enter password: <just hit enter here>

 PS I, personally, am not a fan of the Complete X line of tools. MySQL in particular has been quite good about providing .pkg Mac OS X Installer packages, and the latest release, 4.1 (14.7 Distrib 4.1.7, for apple-darwin7.5.0) is available here ( http://dev.mysql.com/downloads/mysql/4.1.html#Mac_OS_X ).

 No, it doesn't come with a prefpane, but honestly, you don't really need one, especially if you're using phpMyAdmin.


----------

