Home > Database > Mysql Tutorial > body text

MySQL5.1 忘记root密码的解决方法

WBOY
Release: 2016-06-07 16:53:16
Original
1046 people have browsed it

今天登陆 MySQL Query Browser 时发觉密码不正确,奇怪,我一直都是用空密码或者某一个特定密码的尝试多次,还是不正确!不管是啥

今天登陆 MySQL Query Browser 时发觉密码不正确,奇怪,我一直都是用空密码或者某一个特定密码的

尝试多次,还是不正确!不管是啥问题了,当作忘记密码来处理吧

首先在 MySQL的安装目录下 新建一个pwdhf.txt, 输入文本:SET PASSWORD FOR 'root'@'localhost' = PASSWORD('*****'); 

红色部份为 需要设置的新密码

用windows服务管理工具或任务管理器来停止MySQL服务 (任务管理器K掉 mysqld-nt 进程)

Dos命令提示符到 MySQL安装目录下的bin目录 如我的是 D:\Program Files\MySQL\MySQL Server 5.1\bin

然后运行: mysqld-nt --init-file=../pwdhf.txt

执行完毕 停止MySQL数据库服务 (任务管理器K掉 mysqld-nt 进程),然后再重新以正常模式启动MYSQL 即可

linux

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!