忘记Mysql的root密码的处理办法
Jun 07, 2016 pm 06:08 PM1,停止MYSQL服务,CMD打开DOS窗口,输入 net stop mysql 2,在CMD命令行窗口,进入MYSQL安装目录 比如E:\Program Files\MySQL\MySQL Server 5.0\bin 示范命令: 输入 e:回车, 输入cd E:\Program Files\MySQL\MySQL Server 5.0\bin 注意双引号也要输入,这样就
1,停止MYSQL服务,CMD打开DOS窗口,输入 net stop mysql2,在CMD命令行窗口,进入MYSQL安装目录 比如E:\Program Files\MySQL\MySQL Server 5.0\bin
示范命令:
输入 e:回车,
输入cd "E:\Program Files\MySQL\MySQL Server 5.0\bin"
注意双引号也要输入,这样就可以进入Mysql安装目录了.
3,进入mysql安全模式,即当mysql起来后,不用输入密码就能进入数据库。
命令为: mysqld-nt --skip-grant-tables
(Mysql 5.5为:
mysqld --skip-grant-tables
)
4,重新打开一个CMD命令行窗口,输入mysql -uroot -p,使用空密码的方式登录MySQL(不用输入密码,直接按回车)
5,输入以下命令开始修改root用户的密码(注意:命令中mysql.user中间有个“点”)
mysql> update mysql.user set password=PASSWORD('新密码') where User='root';
6,刷新权限表
mysql> flush privileges;
7,退出
mysql> quit
这样MYSQL超级管理员账号 ROOT已经重新设置好了,接下来 在任务管理器里结束掉 mysql-nt.exe 这个进程,重新启动MYSQL即可!(也可以直接重新启动服务器)
MYSQL重新启动后,就可以用新设置的ROOT密码登陆MYSQL了!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP's big data structure processing skills

How to optimize MySQL query performance in PHP?

How to easily get the WiFi password of a connected mobile phone (quickly find the WiFi password saved in the mobile phone)

How to use MySQL backup and restore in PHP?

What should I do if my Win10 password does not meet the password policy requirements? What to do if my computer password does not meet the policy requirements?

What are the application scenarios of Java enumeration types in databases?

How to insert data into a MySQL table using PHP?

How to fix mysql_native_password not loaded errors on MySQL 8.4
