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

mysql root 忘记密码 破解

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


service mysqld stop #通知mysql服务

vim /etc/my.cnf     #编辑配置文件


添加 skip-grant-tables 

保存配置文件 重启服务


mysql -p      #登陆mysql


update mysql.user set password=password(‘123456‘) where user =‘root‘;

#讲root密码修改为123456


设置 #skip-grant-tables  关闭设置

/etc/init.d/mysqld restart


以上就可在忘记密码情况下 修改密码



在未登录mysql的情况下重设密码


mysqladmin -u root -p password "123456" 按下回车键

输入原密码 1234567890 按下回车键


将原root密码在不登陆mysql的情况下由 1234567890 修改为 123456







mysql root 忘记密码 破解

标签:mysql

人气教程排行