windows下:
Copy after login
1. 停止mysql服务
Copy after login
<img src="http://img.bitscn.com/upimg/allimg/c140719/1405K4I3Z620-24013.jpg" alt="">
Copy after login
2. 在DOS窗口下, 进入mysql安装目录的bin目录下, 跳过权限检测, 启动mysql:<pre class="brush:php;toolbar:false">mysqld -nt --skip-grant-tables
Copy after login
<img src="http://img.bitscn.com/upimg/allimg/c140719/1405K4I4343P-3bG.jpg" alt="">
Copy after login
<img src="http://img.bitscn.com/upimg/allimg/c140719/1405K4I4U940-45636.jpg" alt="">
Copy after login
3. 重新打开一个窗口,进入bin目录下,设置新的root密码.../bin>mysqladmin -u root flush-privileges password "newpassword".../bin>mysqladmin -u root -p shutdown 提示你输入密码,输入newpassword进入数据库4. 停止mysql server,用正常模式启动mysql,然后用上面账号就可以登陆数据库库了。
Copy after login