The error message you get when you enter wrong password in the login page is : "#1045 - Access denied for user 'root'@'localhost' (using password: NO) "
Steps:
- Stop mysql - $ /etc/init.d/mysql stop
- Kill all mysql related processes. The ps list can be pretty big and confusing so better use grep to filter mysql processes and use only those pids in kill command. - $ ps waux | grep mysql, $kill -9 pids
- Open a new session of mysql by skipping permissions - $ /usr/bin/mysqld_safe --skip-grant-tables
- While the above session is open, in a new tab open a new session of mysql - $ /usr/bin/mysql
- Inside the new session,change the database - (inside mysql)$use mysql;
- The critical part of our unlocking process is resetting the password for root user -(inside mysql) $UPDATE user SET Password=PASSWORD('YOUR_PASSWORD_HERE')
WHERE Host='localhost' AND User='root'; - This step sets new password for the root user. - Then quit the mysql sessions and restart the mysql - $quit, $/etc/init.d/mysql restart
- try logging into phpmyadmin with new password you set in update command and viola!
P.S: List of useful SQL command syntax - source
METHOD 2:
This step is to change the MYSQL root password. Source: Ubuntu help documentation. In a terminal enter the following command:
"sudo dpkg-reconfigure mysql-server-5.1"
However verify you have mysql-server-5.1 in your system. To find that, in terminal type "mysql -V". The result would print out details about the mysql server installed in your system.Sample result was
"mysql Ver 14.14 Distrib 5.1.41, for debian-linux-gnu (i486) using readline 6.1". Hence I use 5.1 in the above command. When you run the reconfigure command, it will prompt you to enter password and restarts the mysql daemon.
No comments:
Post a Comment