linux 忘记MySql8.0修改root密码
- 跳过权限登录:
CentOS系统:
vim /etc/my.cnf
[mysqld]
skip-grant-tables ##my.cnf文件[mysqld]追加此行,跳过权限表
- 无密码登录
重启mysql
systemctl restart mysqld
知识来源于这位博主
- 修改MySQL密码:
mysql> use mysql;
mysql> update user set authentication_string='' where user='root';
mysql><