1, modify the MySQL configuration file, so that MySQL login to skip password verification
Skip-grant-tables
2. Restart MySQL Service
Service MySQL Restart
3. Go to MySQL and change the password in the user table
[Root] #mysql-u rootmysql> show Databases;mysql> Use mysql;mysqlset Password=password ('root'where'root'; MySQL>exit
4, restore the MySQL configuration file, the code line just added skip-grant-tables delete or use # comment out
5. After restarting MySQL, enter MySQL again, using the password you just modified
Mysql-u Root-proot
6. Set the password for the database again
Mysql> SET Password=password ('root');
7. After re-entering the MySQL database, if you can view the database, complete the password reset
Done ~
centos6.5_x64 install MySQL-5.6.17, in the case of the MySQL service has been started, a password error error 2002 (HY000)