1. 在配置文件中添加一行skip_grant_tables
2. 重启服务
3. 进入MySQL数据库中,不用输入密码回车即可
4. 输入 update mysql.user set authentication_string=password('123qqq...A') where user='root' and host='localhost';
5. 刷新 FLUSH PRIVILEGES
6. 退出数据库 exit
7. 重启数据库