当前位置:网站首页>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开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦
边栏推荐
- unity2d game
- Gaussian distribution and its maximum likelihood estimation
- PWN ROP
- MySQL修改root账号密码
- qlib架构
- MySQL数据库安装配置保姆级教程(以8.0.29为例)有手就行
- MySQL数据库必会的增删查改操作(CRUD)
- 【debug锦集】Expected input batch_size (1) to match target batch_size (0)
- Create componentized development based on ILRuntime hot update
- 【云原生】DevOps(五):集成Harbor
猜你喜欢

MATLAB/Simulink & & STM32CubeMX tool chain completes model-based design development (MBD) (three)

Solved (the latest version of selenium framework element positioning error) NameError: name 'By' is not defined

重磅 | 基金会为白金、黄金、白银捐赠人授牌

C language confession code?

开放原子开源基金会秘书长孙文龙 | 凝心聚力,共拓开源

SOLVED: After accidentally uninstalling pip (two ways to manually install pip)

【C语言】操作符详解

idea工程明明有依赖但是文件就是显示没有,Cannot resolve symbol ‘XXX‘

Notes on the establishment of the company's official website (6): The public security record of the domain name is carried out and the record number is displayed at the bottom of the web page

【R语言】【3】apply,tapply,lapply,sapply,mapply与par函数相关参数
随机推荐
Solved (the latest version of selenium framework element positioning error) NameError: name 'By' is not defined
开源社区三十年 | 2022开放原子全球开源峰会开源社区三十年专题活动圆满召开
关于出现大量close_wait状态的理解
Learning DAVID Database (1)
three.js make 3D photo album
MySQL数据库备份
C Implementation of Simple Network File Copy
three.js 制作3D相册
Unity资源管理系列:Unity 框架如何做好资源管理
【wpf】wpf中的那些模板之深度解析
Industry landing presents new progress | 2022 OpenAtom Global Open Source Summit OpenAtom OpenHarmony sub-forum was successfully held
mysql基础知识(二)
ERROR 2003 (HY000) Can't connect to MySQL server on 'localhost3306' (10061)Solution
MySQL database must add, delete, search and modify operations (CRUD)
[py script] batch binarization processing images
volatile内存语义以及实现 -volatile写和读对普通变量的影响
Unity教程:URP渲染管线实战教程系列【1】
binom二项分布,
The idea project obviously has dependencies, but the file is not displayed, Cannot resolve symbol 'XXX'
ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)解决办法