当前位置:网站首页>MySQL忘记密码怎么办
MySQL忘记密码怎么办
2022-07-29 02:47:00 【emgexgb_sef】
mysql忘记密码是常用的事情,那么如何解决它呢?
1、首先将MySQL的服务关闭,两种方法:
(1)打开命令行cmd输入net stop mysql命令即可关闭MySQL服务。
(2)找到服务,找到MYSQL56(我电脑装的是mysql5.6,所以这里是MYSQL56)然后关闭
2、打开MySQL安装路径,进入到bin目录中,两种方法:
(1)在目录输入cmd,即可以命令行窗口,且所在的目录也是bin目录下
(2)或者打开命令行,输入cd F:mysqlin回车
3、去掉认证检查
mysqld --skip-grant-tables
在上一步的cmd窗口,输入mysqld --skip-grant-tables然后回车
这个命令是去掉认证检查。为下面的操作做准备,请勿关闭!!!
4、进入到mysql容器
打开新的命令行,输入mysql回车
mysql

5、验证数据库是否登录成功
show databases;

数据库说明成功登陆。
6、输入 使用mysql数据库。
use mysql;
mysql数据库就是保存用户名和密码。
7、查看所有表
show tables;
user表存放用户名,密码,权限等等账户信息。
8、 查看账户信息
select user,host,password from user;

9、 更改root密码,密码为123456
update user set password=password('123456') where user='root' and host='localhost';

10、再次查看账户信息
select user,host,password from user;
可以看到密码已被修改。
11、在Navicat验证数据库。

这样就可以解决忘记数据库密码的问题啦~~~
边栏推荐
- Family relationship calculator wechat applet source code
- .NET 序列化枚举为字符串
- Really time NTP service startup command
- 并发模式之单例和不变模式
- MySQL compound query (important)
- 创客教育的起源和内涵的基本理念
- golang 协程的实现原理
- Pgzero飞机大战
- DHCP protocol detailed analysis
- Weekly recommended short videos: how to make product development more effective?
猜你喜欢
随机推荐
Analysis of OWT server source code (III) -- video module analysis of mixer in
数据截断及估计
Mongodb index (3)
【OpenCV】使用OpenCV调用手机摄像头
践踏---离散化+树状数组+差分
金山云回港上市:中国TO B云厂商的港股奔袭
Flink内核源码(七)Flink SQL提交流程
Unable to start after idea installation
The basic concept of the origin and connotation of maker Education
Plug in --- line segment sloth marking board + simple mathematical reasoning
Day 10 notes
[Luogu p8352] independent set of small n (DP set DP) (property)
DHCP协议详细解析
RestfulAPI——C#——增加header用户名密码验证
MySQL - count(字段)、count(主键)、count(1)、count(*)的区别
Analyzing the subjective consciousness of emotional resonance between robots and human beings
Jinshan cloud returns to Hong Kong for listing: Hong Kong stock rush of Chinese to B cloud manufacturers
C language: Little Lele and hexadecimal conversion
PHP lucky draw system with background source code
Pgzero飞机大战









