Home >Database >Mysql Tutorial >mysql数据库忘记root密码解决方法_MySQL

mysql数据库忘记root密码解决方法_MySQL

WBOY
WBOYOriginal
2016-06-01 13:06:071003browse
windows下:
1. 停止mysql服务
<img src="http://img.bitscn.com/upimg/allimg/c140719/1405K4I3Z620-24013.jpg" alt="">

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




    
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn