1

Ive had mysql up and running for month now. I was using it yesterday, and today I go to login via phpmyadmin and the command line and I suddenly can't. Its as if someone changed my password overnight or something. Im trying to login using the root user. What do I do?

Edit

This is mysql just running on my local laptop for development. The only account on it is the root account, and no caps lock is not on.

Deekor
  • 9,144
  • 16
  • 69
  • 121

2 Answers2

2

http://www.cyberciti.biz/tips/recover-mysql-root-password.html says this five step process will work, try at your own risk obviously. This source also has essentially the same steps. This likely won't work on windows, but something similar should http://www.debian-administration.org/articles/442

Stop mysql service using /etc/init.d/mysql stop

Start mysql without password using mysqld_safe --skip-grant-tables &

Connect to the server using mysql -u root

Change the root password:

mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit

Stop the Server: /etc/init.d/mysql stop

Start the Server: /etc/init.d/mysql start

Test: mysql -u root -p

Ghost
  • 2,146
  • 19
  • 21
0

I used the link raina77ow provided and followed the instructions to reset my password and it works now.

Scrolling down to section C.5.4.1.3. Resetting the Root Password: Generic Instructions was particularly helpful.

Deekor
  • 9,144
  • 16
  • 69
  • 121