码迷,mamicode.com
首页 > 数据库 > 详细

linux下忘记mysql的root密码

时间:2019-04-13 22:05:31      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:style   更新   HERE   tab   mys   方式   root密码   grant   ant   

一.处理方案

#1. 结束当前正在运行的mysql进程

 /etc/init.d/mysql stop

#2. 用mysql安全模式运行并跳过权限验证

mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

#3. 用空密码方式使用root用户登录 MySQL

#  mysql -u root mysql 

#4. 更新密码为root

update user set Password = PASSWORD(root) where User =root;

#5. 刷新权限

FLUSH PRIVILEGES; 

#6. 退出

quit

 

linux下忘记mysql的root密码

标签:style   更新   HERE   tab   mys   方式   root密码   grant   ant   

原文地址:https://www.cnblogs.com/tjp40922/p/10702962.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!