重设mysql数据库root用户密码

 原文:http://blog.sina.com.cn/s/blog_a3695da601010mrs.html
 

1, 启用任务管理器,结束mysql进程
 
2,进入命令行,进入mysql的bin目录(<环境变里>path里面可以找到bin目录)启动mysql服务:
mysqld -nt --skip-grant-tables  (以不检查权限的方式启动);
(可能会出现:120705 17:41:14 [Warning] option 'new': boolean value 't' wasn't recognized. Set to OFF.不过依然可以继续。)

3,重新打开一个命令提示窗口
   输入:mysql -uroot
 
4, 修改root密码:
   update mysql.user set authentication_string=PASSWORD('newpass') where User='root';
5, flush privileges;
6, quit
忘记了mysql数据库root用户密码
重新连接mysql
posted @ 2016-04-13 23:33  麥片  阅读(242)  评论(0编辑  收藏  举报