-
修改my.cnf配置 sed -i ‘/mysqld/a\skip-grant-tables’ /etc/my.cnf
-
重启mysql
systemctl restart mysqld
-
进入mysql
这次就不需要root密码了
-
use mysql;
-
UPDATE user SET Password = password('newpassword') where User = 'roo
-
刷新权限
flush privileges;
-
退出
quit
扫描二维码关注公众号,回复: 6863358 查看本文章 -
还原my.cnf配置sed -i 's/skip-grant-tables/#skip-grant-tables/g' /etc/my.cnf
-
再次重启mysql服务
systemctl restart mysqld
centos中跳过权限修改密码
猜你喜欢
转载自www.cnblogs.com/tuzaizi/p/11242033.html
今日推荐
周排行