我们已经准备好了,你呢?

我们与您携手共赢,为您的企业形象保驾护航!

当前位置: 首页 > 百科知识问答 > 忘记root密码怎么办?Windows平台下MYSQL破解root密码流程

Windows平台下MYSQL破解root密码(忘记root密码的解决方法)

1、停止MYSQL服务,开始→运行→CMD打开DOS窗口,输入net stop mysql

C:/Documents and Settings/skate_db>net stop mysqlMySQL 服务正在停止.MySQL 服务已成功停止。

2、在开始→运行→CMD命令行窗口,进入MYSQL安装目录

C:/Documents and Settings/skate_db>cd C:/Program Files/MySQL/MySQL Server 5.0/bin

3、进入mysql安全模式,即当mysql起来后,不用输入密码就能进入数据库。

C:/Program Files/MySQL/MySQL Server 5.0/bin>mysqld-nt --skip-grant-tables100423 10:27:27 [Warning] Changed limits: max_open_files: 2048  max_connections:800  table_cache: 619

4、重新打开一个开始→运行→CMD命令行窗口,输入mysql –u root -p,使用空密码的方式登录MySQL(不用输入密码,直接按回车)

C:/Documents and Settings/skate_db>mysql -u root -pEnter password:Welcome to the MySQL monitor.  Commands end with ; or /g.Your MySQL connection id is 1 to server version: 5.0.22-community-ntType 'help;' or '/h' for help. Type '/c' to clear the buffer.mysql>

5、输入以下命令开始修改root用户的密码(注意:命令中mysql.user中间有个“点”)

命令:mysql>update mysql.user set password=PASSWORD('新密码') where User='root';

mysql> update mysql.user set password=password('root') where user='root';Query OK, 2 rows affected (0.06 sec)Rows matched: 2  Changed: 2  Warnings: 0

6、保存配置,刷新权限表

mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)mysql>

7、退出

mysql> quit

这样MYSQL超级管理员账号ROOT已经重新设置好了,因为心在mysql还是运行在安全模式下,所以在windows的任务管理器里kill掉mysql-nt.exe这个进程,重新启动mysql,用新设置的root密码登录。

C:/Documents and Settings/skate_db>net start mysqlMySQL 服务已经启动成功。C:/Documents and Settings/skate_db>mysql -u root -pEnter password: ****Welcome to the MySQL monitor.  Commands end with ; or /g.Your MySQL connection id is 2 to server version: 5.0.22-community-ntType 'help;' or '/h' for help. Type '/c' to clear the buffer.mysql>-----end-----
免责声明:本站内容(文字信息+图片素材)来源于互联网公开数据整理或转载,仅用于学习参考,如有侵权问题,请及时联系本站删除,我们将在5个工作日内处理。联系邮箱:chuangshanghai#qq.com(把#换成@)

我们已经准备好了,你呢?

我们与您携手共赢,为您的企业形象保驾护航!

在线客服
联系方式

热线电话

132-7207-3477

上班时间

周一到周五 09:00-18:00

二维码
线