当前位置:Gxlcms > 数据库问题 > mysql 忘记root密码

mysql 忘记root密码

时间:2021-07-01 10:21:17 帮助过:3人阅读

mysql 忘记root密码怎么办

密码 mysql
如果忘记root密码或其他用户密码,不要急,按下面操作即可。
1. 编辑mysql主配置文件 my.cnf
vim /etc/my.cnf
在[mysqld]字段下添加参数 skip-grant
2. 重启数据库服务
service mysqld restart
3. 这样就可以进入数据库不用授权了
mysql -uroot
4. 修改相应用户密码
use mysql;
update user set password=password(‘your password‘) where user=‘root‘;
flush privileges;
5. 修改/etc/my.cnf 去掉 skip-grant , 重启mysql服务

mysql 忘记root密码

标签:roo   where   date   upd   参数   pass   重启   配置   restart   

人气教程排行