- vim /etc/my.cnf
- 找到对应的[mysqld]在这一段内的添加skip-grant-tables
wq!保存。 - service mysqld restart 重启MySQL的服务
- mysql -uroot -p 登录你的账号,密码是空,直接回车。
- 登录成功后,使用 use mysql;
- update user set authentication_string=password(“123456”) where user=‘root’;
- flush privileges; 刷新系统授权表
linux+mysql忘记密码
最新推荐文章于 2023-12-06 23:09:59 发布