启动msql进程时,为其使用:--skip-grant-tables --skip-networking
使用update mysql.user set password=PASSWORD(‘your_password‘) where user=‘username‘ and host=‘hostname or ip‘
关闭mysqld 进程,移除上述两个选项,重启mysql
mysql忘记密码
原文:https://www.cnblogs.com/love1314Y/p/14764026.html