MySQL 忘记root密码重置
1.停止mysql服务
# 停止服务
systemctl stop mysqld
# my.conf文件增加一行
[mysqld]
skip_grant_tables
# 重启服务
systemctl start mysqld
# 登陆mysql
mysql
# 重置root用户密码,并刷新权限
update mysql.user set authentication_string=password('pinxxxxxxx3') where user='root' and host='localhost';
flush privileges;
# 退出去掉my.conf文件中的skip_grant_tables
# 重启mysql服务
systemctl start mysqld
# 重置成功

浙公网安备 33010602011771号