首页 > 数据库技术 > 详细

[读书笔记]mysql 找回丢失的root密码

时间:2016-06-23 19:03:54      阅读:151      评论:0      收藏:0      [点我收藏+]

1.停止数据库

service mysql stop

or

/etc/init.d/mysql stop


2.使用下列语句登陆服务器

mysqld_safe --skip-grant-tables --user=root &


3.使用update命令修改密码

update user

set password=password(‘new-password‘)

where user=‘root‘;

密码修改之后刷新

flush privileges


4.退出并重新启动数据库

mysqladmin -u root -p shutdown;

service mysql start

or 

/etc/init.d/mysql start


[读书笔记]mysql 找回丢失的root密码

原文:http://myhwj.blog.51cto.com/9763975/1792243

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!