- 关闭mysql服务
- linux下:mysql_safe --skip-grant-table
- window下:mysqld --skip-grant-table //高版本中无效
- mysqld --console --skip-grant-table --shared-memory
- 执行update密码sql
update mysql.user set authentication_string=password(" ") where mysql.user="root"
Mysql修改root密码
原文:https://www.cnblogs.com/zzw-847776943/p/12600123.html