English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

What to Do If You Forget MySQL Password

Have you forgotten your MySQL password twice? At first, I did the dumbest thing, which was to uninstall and reinstall it.

现在有一个不用卸载也能把密码设置回来的办法。知识来源于网络,我这里稍加整理,遇到同样的朋友,可以试试。

以一下实现都是windows系统上完成。

第一步

在任务管理器中找到mysqld.exe,结束掉该进程。

第二步

找到mysql的安装目录下的bin目录,我的是C:\Program Files\MySQL\mysql-5.6.24\bin

在这个目录下打开控制台,输入:mysqld --skip-grant-tables

第三步

再切换到刚刚的路径下再打开一个新的控制器

1)输入:mysql

2)输入:show databases;

3)   输入:use mysql

4)   输入:show tables;

这时可以看到user表

输入:select user,password,host from user;可以看到表里面的内容。

我们现在通过update修改表里面的数据。

输入:update user set password=passwrod("123456") where user="root" and host="localhost";


The password modification of mysql is completed now.

That's all for this article. I hope it will be helpful to your studies, and I also hope everyone will support the Yelling Tutorial more.

Statement: The content of this article is from the Internet, and the copyright belongs to the original author. The content is contributed and uploaded by Internet users spontaneously. This website does not own the copyright, has not been manually edited, and does not assume relevant legal liability. If you find content suspected of copyright infringement, please send an email to: notice#oldtoolbag.com (Please replace # with @ when sending an email to report abuse, and provide relevant evidence. Once verified, this site will immediately delete the content suspected of infringement.)

You May Also Like