administrator 发表于 2017-2-27 19:38:35

忘记root密码怎么办?Windows平台下MYSQL破解root密码流程

Windows平台下MYSQL破解root密码(忘记root密码的解决方法)1、停止MYSQL服务,开始→运行→CMD打开DOS窗口,输入 net stop mysqlC:/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/bin3、进入mysql安全模式,即当mysql起来后,不用输入密码就能进入数据库。C:/Program Files/MySQL/MySQL Server 5.0/bin>mysqld-nt --skip-grant-tables100423 10:27:27 Changed limits: max_open_files: 2048max_connections:800table_cache: 6194、重新打开一个开始→运行→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: 2Changed: 2Warnings: 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-----
页: [1]
查看完整版本: 忘记root密码怎么办?Windows平台下MYSQL破解root密码流程