skip-grant-tables
例如:
[mysqld]
skip-grant-tables
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
service mysql restart
mysql -uroot -p (直接点击回车,密码为空)
use mysql;
update user set authentication_string=password(‘123456‘) where user=‘root‘;
6 .刷新权限
flush privileges;
7 .退出
exit;
8 .删除第1部增加的配置信息
skip-grant-tables
9 .重启mysql
service mysql restart
原文地址:https://blog.51cto.com/sonice/2415392
时间: 2024-11-07 20:51:08