Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ?

share|improve this question

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

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

    
Try a blank password like - mysql -u root -p mysql password option – arunkumar Oct 15 '11 at 12:51
    
Tried that - doesnt log in. – anjanesh Oct 15 '11 at 13:01

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" 
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .