mysql8.0忘记密码如何找回
为了演示,找个测试环境来操作,千万不要线上这么搞
pkill mysqld 关闭掉mysql
跳过MySQL的权限表启动MySQL服务:
–skip-grant-tables启动mysql
将密码置空:
pkill mysqld 关闭掉mysql
再次启动mysql服务
无密码登录MySQL服务并设置新的密码:
[root@localhost ~]# mysql -uroot -p’jist558@wei’ -e “select version();”
mysql: [Warning] Using a password on the command line interface can be insecure.
±----------+
| version() |
±----------+
| 8.0.13 |
±----------+
密码写入.my.cnf文件就可以mysql直接登录mysql窗口:
演示完毕

浙公网安备 33010602011771号