zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

MySQL重置root密码

mysql密码密码 root 重置
2023-09-11 14:22:18 时间

vim /etc/my.cnf

在mysqld下添加 skip-grant-tables

重启服务

如果是mysql5.7以后的版本:

update user set authentication_string='root' where user='root';

如果是mysql5.7以前的版本

update user set password=password('root') where user='root';

退出

vim /etc/my.cnf

去掉 skip-grant-tables

重启服务,登录即可