Today would like to use the lab server MySQL, found that do not remember the user name password.
Here's how to fix it:
1. Ensure that the server is in a safe state, if possible, unplug the network cable ... (But I skipped this step, the amount)
2. Modify the/etc/my.cnf file
In the paragraph [mysqld], add:
Skip-grant-tables
Save exit.
3. Restart MySQL
Service MySQL Restart
(Why a lot of places are written mysqld, will error, drunk)
4. Log in to MySQL and enter MySQL directly
is not very magical, no password on the landing, because you have modified the configuration file Na Pro
5. Change the password, the user in MySQL is the system specifically to manage users of the table, note that the following password is a function, used to the back of the New-password encrypted
mysql> use MySQL;
mysql> UPDATE user SET Password = Password (' New-password ') WHERE user = ' root ';
mysql> flush Privileges;
Mysql> quit
6. Change the 2 config file and go back
7. Restart MySQL, same as Step 3
8. Mysql-uroot-p
It should be OK ~
MySQL User name password forgot the workaround