网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 时尚美容 知识问答

MySQL 忘记root 密码解决方法

时间:2024-10-14 12:00:16

1、mysql服务正常运行ps -ef|grep mysql

MySQL 忘记root 密码解决方法

3、vi /etc/my.cnf,在[mysqld]下面加入skip-grant-tables

MySQL 忘记root 密码解决方法

5、不需要密码直接使用mysql即可登录

MySQL 忘记root 密码解决方法

7、查找系统库中用户的表名show tables;

MySQL 忘记root 密码解决方法

9、mysql> update user set authentication_string=password("haha") where user="root"; Query OK, 1 row affected, 1 warning (0.00 sec)Rows matched: 1 Changed: 1 Warnings: 1mysql> flush privileges;Query OK, 0 rows affected (0.01 sec)

10、vi /etc/my.cnf,在[mysqld]下面去掉skip-grant-tables并重启mysqld服务

MySQL 忘记root 密码解决方法
© 2025 小知经验
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com