1.再 my.cnf 配置文件追加:
skip-grant-tables
skip-networking
2.重启mysql 服务 serive mysql restart
3.输入mysql -uroot 进入到命令行
4.使用命令行修改
update mysql.user set authentication_string=password('你的密码');
5.继续输入:FLUSH PRIVILEGES;
6.使用exit; 退出。然后注释掉my.cnf 中的
#skip-grant-tables
#skip-networking
7.重启mysql服务
网友评论