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

mysql忘记密码

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

步骤

1 停止数据库 

/etc/init.d/mysqld stop

2 使用--skip-grant-tables 忽略授权表启动数据库服务

/usr/local/mysql/bin/mysqld_safe --skip-grant-tables &

3 mysql 直接进入更改密码

update mysql.user set password=password(‘c110123‘) where user=‘root‘ and host=‘localhost‘;

   

flush privileges;

4 退出 

quit

5 重新启动mysqld,先关闭

用这个方式去关闭 

mysqladmin -uroot -pc110123 shutdown


这个时候不能用 /etc/init.d/stop 因为是mysqld_safe 启动的

6 启动

/etc/init.d/mysqld start

技术分享


本文出自 “崔德华运维打工从业路” 博客,请务必保留此出处http://cuidehua.blog.51cto.com/5449828/1762141

mysql忘记密码

标签:mysql   忘记密码   

人气教程排行