I installed MySQL on a Mac OSX Snow Leopard and got the mysql service started but I couldn't login as root to reset the password.

  1. Couldn't login as root either.

    $ ./mysql -u root ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

  2. Neither did mysqladmin work

    ./mysqladmin -u root password "password" ./mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: NO)'

How do set/reset my MySQL password ?

migrated from stackoverflow.com Oct 15 '11 at 19:07

This question came from our site for professional and enthusiast programmers.

Make sure you are first logged into your local system as root, and then reset the password with mysqladmin like:

./mysqladmin -u root password "password" 

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.