当前位置:网站首页>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开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦
边栏推荐
- Exsl file preview, word file preview web page method
- 强化学习:从入门到入坑再到拉屎
- Interview | Cheng Li, CTO of Alibaba: Cloud + open source together form a credible foundation for the digital world
- binom二项分布,
- 专访 | 阿里巴巴首席技术官程立:云+开源共同形成数字世界的可信基础
- MySQL based operations
- Regarding the primary key id in the mysql8.0 database, when the id is inserted using replace to be 0, the actual id is automatically incremented after insertion, resulting in the solution to the repea
- Go语学习笔记 - 处理超时问题 - Context使用 | 从零开始Go语言
- Open Source Database Innovation in the Digital Economy Era | 2022 Open Atom Global Open Source Summit Database Sub-Forum Successfully Held
- el-image tag doesn't work after binding click event
猜你喜欢

MySQL数据库安装配置保姆级教程(以8.0.29为例)有手就行

【C语言进阶】文件操作(一)

XSS shooting range (3) prompt to win

WPF WPF 】 【 the depth resolution of the template

(5) final, abstract class, interface, inner class

The input input box displays the precision of two decimal places

Interview | Cheng Li, CTO of Alibaba: Cloud + open source together form a credible foundation for the digital world

qlib架构

ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)

Recursive implementation of the Tower of Hanoi problem
随机推荐
【C语言进阶】文件操作(一)
unity2d小游戏
【R语言】【3】apply,tapply,lapply,sapply,mapply与par函数相关参数
Unity Tutorial: URP Rendering Pipeline Practical Tutorial Series [1]
MySQL数据库安装配置保姆级教程(以8.0.29为例)有手就行
ERROR 2003 (HY000) Can't connect to MySQL server on 'localhost3306' (10061)
Smartcom Programming Level 4 - Magic Academy Lesson 6
微软 AI 量化投资平台 Qlib 体验
聚变云原生,赋能新里程 | 2022开放原子全球开源峰会云原生分论坛圆满召开
Error EPERM operation not permitted, mkdir ‘Dsoftwarenodejsnode_cache_cacach两种解决办法
MySQL fuzzy query can use INSTR instead of LIKE
Can't load /home/Iot/.rnd into RNG
(8) Math class, Arrays class, System class, Biglnteger and BigDecimal classes, date class
open failed: EACCES (Permission denied)
VScode+ESP32快速安装ESP-IDF插件
Industry-university-research application to build an open source talent ecosystem | 2022 Open Atom Global Open Source Summit Education Sub-Forum was successfully held
[py script] batch binarization processing images
参考代码系列_1.各种语言的Hello World
C language confession code?
Minesweeper game - C language