当前位置:网站首页>MySQL忘记密码怎么办
MySQL忘记密码怎么办
2022-07-31 04:47:00 【geejkse_seff】
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验证数据库。

这样就可以解决忘记数据库密码的问题啦~~~
先自我介绍一下,小编13年上师交大毕业,曾经在小公司待过,去过华为OPPO等大厂,18年进入阿里,直到现在。深知大多数初中级java工程师,想要升技能,往往是需要自己摸索成长或是报班学习,但对于培训机构动则近万元的学费,着实压力不小。自己不成体系的自学效率很低又漫长,而且容易碰到天花板技术停止不前。因此我收集了一份《java开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦
边栏推荐
- MySQL基础操作
- Unity框架设计系列:Unity 如何设计网络框架
- Unity Tutorial: URP Rendering Pipeline Practical Tutorial Series [1]
- MySQL数据库必会的增删查改操作(CRUD)
- On Governance and Innovation | 2022 OpenAtom Global Open Source Summit OpenAnolis sub-forum was successfully held
- 数字经济时代的开源数据库创新 | 2022开放原子全球开源峰会数据库分论坛圆满召开
- Knowledge Distillation 7: Detailed Explanation of Knowledge Distillation Code
- 手把手实现图片预览插件(三)
- BUG destroyer!!Practical debugging skills are super comprehensive
- 论治理与创新 | 2022开放原子全球开源峰会OpenAnolis分论坛圆满召开
猜你喜欢

exsl文件预览,word文件预览网页方法

qlib架构

强化学习:从入门到入坑再到拉屎

BUG destroyer!!Practical debugging skills are super comprehensive

STM32HAL库修改Hal_Delay为us级延时

Win10 CUDA CUDNN installation configuration (torch paddlepaddle)

Knowledge Distillation 7: Detailed Explanation of Knowledge Distillation Code

Unity手机游戏性能优化系列:针对CPU端的性能调优

ERROR 1819 (HY000) Your password does not satisfy the current policy requirements

ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)解决办法
随机推荐
qlib自动化quant
[Linear Neural Network] softmax regression
递归实现汉诺塔问题
(8) Math class, Arrays class, System class, Biglnteger and BigDecimal classes, date class
Open Source Database Innovation in the Digital Economy Era | 2022 Open Atom Global Open Source Summit Database Sub-Forum Successfully Held
Interview | Cheng Li, CTO of Alibaba: Cloud + open source together form a credible foundation for the digital world
Sun Wenlong, Secretary General of the Open Atom Open Source Foundation |
open failed: EACCES (Permission denied)
Learning DAVID Database (1)
STM32HAL库修改Hal_Delay为us级延时
The third is the code to achieve
Safety 20220718
exsl文件预览,word文件预览网页方法
Go语学习笔记 - 处理超时问题 - Context使用 | 从零开始Go语言
VScode+ESP32快速安装ESP-IDF插件
volatile内存语义以及实现 -volatile写和读对普通变量的影响
(5) final, abstract class, interface, inner class
unity2d小游戏
[R language] [3] apply, tapply, lapply, sapply, mapply and par function related parameters
Open Source Smart Future | 2022 OpenAtom Global Open Source Summit OpenAtom openEuler sub-forum was successfully held