Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using SequelPro (http://www.sequelpro.com/) and I would like to know how to reset my root password. I'm trying to log in as

host: localhost
username: root
password: (BLANK)

But I keep getting this error:

Unable to connect to host because access was denied.
Double-check your username and password and ensure that access from your current location is permitted.
MySQL said: Access denied for user 'root'@'localhost' (using password: NO)

Any suggestions?!

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Depending on what you're using to run MySQL, you could take a look at the official instructions.

If you're using MAMP or something similar you need to find where mysqladmin is located.

/Applications/MAMP/Library/bin/mysqladmin -u root -p password ’somepassword’

If you are using another installation of mysql, you may be able to find out where it is located with:

$ which mysqladmin 
share|improve this answer
    
Thanks! I was using the program MySQL. I started using MAMP thanks to your suggestion, and now it all works. Thanks again! –  classicrock985 Mar 25 '10 at 14:37
    
Just an FWI you can accept this as the answer by clicking the check mark under the vote indicators. Glad it helped. –  Josh K Mar 25 '10 at 15:26
    
This post saved my butt. Thanks!! –  classicrock985 May 1 '10 at 3:44
add comment

Here is the procedure to reset password of root user.

1) Stop mysql (Kill mysql process or run following command)

sudo /usr/local/mysql/support-files/mysql.server stop

2) Start it in safe mode

sudo mysqld_safe --skip-grant-tables

3) Open another terminal and run the following command (Keep last terminal open)

mysql -u root

4) Run the following command with suitable new password on the mysql console

mysql > UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';

5) mysql > FLUSH PRIVILEGES;

6) Quit from both terminals and open new terminal and connect to mysql with root user and new password

mysql -uroot -p
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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