How to recovery mysql root password if you forgot it.
One of the recovery methods for a .MySQL password If you forget the MySQL root password, you can use the following methods to re-set: 1. Switch to root Su root 2. KILL out of the system in the MySQL process; Killall -TERM mysqld 3. Start MySQL with the following command to start without checking the permissions; Safe_mysqld --skip-grant-tables & 4. Then use the empty password to use the root user login to MySQL; Mysql -u root 5. Modify the root user's password; Mysql> update mysql.user set authentication_string = PASSWORD ('123456') where User = 'root'; Mysql> flush privileges; Mysql> quit Restart MySQL, you can use the new password login. Second, the MySQL password recovery method II There may be no system safe_mysqld procedures (ubuntu operating system, apt-get installed mysql), the following method can be restored 1. Switch to root Su root 2. stop mysqld; /etc/init.d/mysql stop 3. Start MySQL with the following command to start without checking