标签:user 忘记 vim linux中 ble emctl root tables use
1.vim /etc/my.cnf
[mysqld]
skip-grant-tables ##追加此行,跳过权限表,
2.重启mysql
systemctl restart mysqld
3.mysql 登陆mysql
mysql> use mysql;
mysql> UPDATE user SET Password = password ( ‘zha123456‘ ) WHERE User = ‘root‘ ;
mysql> flush privileges ;
mysql> quit
4.恢复配置文件my.cnf
vim /etc/my.cnf
[mysqld]
skip-grant-tables ##去掉此行,继续校验权限表,
5.重启mysql
systemctl restart mysqld
标签:user 忘记 vim linux中 ble emctl root tables use
原文地址:https://www.cnblogs.com/zhaoguiyuan/p/11116155.html