windows下mysql忘记root密码的解决方法

2014-11-24 11:56:27 · 作者: · 浏览: 0

windows下 mysql忘记root密码的解决方法
1、在DOS窗口下输入:
1 net stop mysql
www.2cto.com
2、开一个DOS窗口,这个需要切换到mysql的bin目录,输入:
1 */bin/mysqld-nt.exe
2 mysqld-nt --skip-grant-tables;
再开一个DOS窗口,输入:
1 mysql -u root
www.2cto.com
4、继续输入:
1 use mysql
2 update user set password=password("new_pass") where user="root";
3 flush privileges;
4 exit
5、使用任务管理器,找到mysqld-nt的进程,结束进程