解决MySQL忘记密码问题的方法
作者:请叫我小东子 时间:2022-04-05 07:55:43
为大家提供的MySQL忘记密码的解决方案,供大家参考,具体内容如下
1.在操作系统windows操作系统,xp或win7.中进入如下目录:
C:\Users\Administrator>cd C:\Program Files\MySQL\MySQL Server 5.5\bin
2.停止MySQL服务
C:\Program Files\MySQL\MySQL Server 5.5\bin>net stop mysql
//MySQL 服务正在停止.
//MySQL 服务已成功停止。
3.跳过授权给表
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysqld --skip-grant-tables
你会看到窗口光标在下一行的第一个位置闪烁,这说明已经启动了,不需要管。
4. 新建一个命令行窗口同样进入到e:\mysql5.5\bin目录,启动mysql
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.36 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)
5.选择mysql数据库
mysql> use mysql;
Database changed
mysql> update user set password=PASSWORD('root') where user='root';
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2 Changed: 2 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
6.退出mysql终端:
mysql> quit
Bye
7.看看那任务管理器中是否有mysqld.exe进程,如有,kill .
8.启动mysql服务器
C:\Program Files\MySQL\MySQL Server 5.5\bin>net start mysql
//MySQL 服务正在启动 .
//MySQL 服务已经启动成功。
9.登录mysql服务器
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql -u root -p root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.36 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
以后再也不用担心MySQL忘记密码了。
标签:MySQL,忘记密码
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
基于Spring AOP proxyTargetClass的行为表现总结
2022-05-23 18:33:43
Java file类中renameTo方法操作实例
2021-06-13 01:21:03
![](https://img.aspxhome.com/file/2023/7/65357_0s.png)
c#和javascript函数相互调用示例分享
2023-10-08 21:33:52
Java使用线程同步解决线程安全问题详解
2022-02-28 02:03:24
![](https://img.aspxhome.com/file/2023/9/78029_0s.png)
android实现QQ微信侧滑删除效果
2021-07-11 15:58:11
![](https://img.aspxhome.com/file/2023/0/97870_0s.jpg)
C#中计算时间差中的小数问题解决
2023-11-02 19:38:05
Spring Boot整合Mybatis并完成CRUD操作的实现示例
2023-11-09 04:36:46
![](https://img.aspxhome.com/file/2023/7/59377_0s.png)
c语言实现的几种常用排序算法
2022-02-23 04:04:11
![](https://img.aspxhome.com/file/2023/4/117754_0s.jpg)
Android编程之播放器MediaPlayer实现均衡器效果示例
2022-02-25 11:52:32
Java二维数组计算集合总结
2023-02-15 16:38:14
![](https://img.aspxhome.com/file/2023/8/63998_0s.jpg)
如何利用Jenkins + TFS为.Net Core实现持续集成/部署详解
2022-11-12 06:14:32
![](https://img.aspxhome.com/file/2023/2/92962_0s.png)
Android中实现GPS定位的简单例子
2021-11-24 21:01:25
Struts 2中实现Ajax的三种方式
2022-04-30 05:46:28
![](https://img.aspxhome.com/file/2023/7/65307_0s.jpg)
C++ OpenCV单峰三角阈值法Thresh_Unimodal详解
2022-06-09 14:36:46
![](https://img.aspxhome.com/file/2023/6/129546_0s.png)
Java压缩解压zip技术_动力节点Java学院整理
2022-08-29 22:50:42
![](https://img.aspxhome.com/file/2023/8/84208_0s.png)
C#使用SharpZipLib压缩解压文件
2021-10-27 18:56:21
使用SpringBoot自定义starter的完整步骤
2023-09-26 02:41:48
![](https://img.aspxhome.com/file/2023/8/71608_0s.png)
java多线程Thread的实现方法代码详解
2022-01-03 01:02:28
如何使用Java redis实现发送手机验证码功能
2023-11-26 17:25:00
谈谈Java中Volatile关键字的理解
2021-07-08 04:49:13