WenRou's Blog
MySQL忘记root密码解决办法
2013-9-27 温柔哥

MySQL忘记root密码解决办法 :在linux下:


  如果 MySQL 正在运行,首先杀之: killall -TERM MySQLd。


  启动 MySQL :bin/safe_MySQLd --skip-grant-tables &


  就可以不需要密码就进入 MySQL 了。


  然后就是


  1.>use MySQL


  2.>update user set passwordpassword=password("new_pass") where user="root";


  3.>flush privileges;


  重新杀 MySQL ,用正常方法启动 MySQL 。


发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容