Vim/etc/my. cnf add skip-grant-tables
/Etc/init. d/mysqld restart
Mysql
Use mysql
Update user set password = password ("XMY_vI105VxV") where user = "root ";
Flush privileges;
Exit
/Etc/init. d/mysqld restart
Win is to modify my. ini, and the same Restart service takes effect.
1. First open the/etc/my. cnf file and add skip-grant-tables in [mysqld ].
1
2. Save and restart mysql/etc/init. d/mysqld restart
II
3. log on to mysql directly without a password
3.
4. Run the command to fix the root password of mysql.
5. Modify/etc/my. cnf again. Delete the skip-grant-tables under [mysqld] and restart mysql.
V.
The first command modifies the my. conf or my. ini (win)
The second command is to log on to mysql (you can log on directly without restarting)
The third command is to exit mysql.
The fourth command is to restart apache.
The Fifth Command is to log on to mysql and report an error.
The sixth command is to log on to mysql with the modified password.