当前位置:网站首页>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开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦
边栏推荐
- Thinking about data governance after Didi fines
- 开放原子开源基金会秘书长孙文龙 | 凝心聚力,共拓开源
- STM32HAL库修改Hal_Delay为us级延时
- VScode+ESP32快速安装ESP-IDF插件
- Unity URP渲染管线摄像机核心机制剖析
- (8) Math class, Arrays class, System class, Biglnteger and BigDecimal classes, date class
- Understanding of the presence of a large number of close_wait states
- Knowledge Distillation 7: Detailed Explanation of Knowledge Distillation Code
- 【py脚本】批量二值化处理图像
- Open Source Database Innovation in the Digital Economy Era | 2022 Open Atom Global Open Source Summit Database Sub-Forum Successfully Held
猜你喜欢

HCIP Day 10_BGP Route Summary Experiment

ENSP,划分VLAN、静态路由,三层交换机综合配置

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

(8) Math class, Arrays class, System class, Biglnteger and BigDecimal classes, date class

The idea project obviously has dependencies, but the file is not displayed, Cannot resolve symbol 'XXX'

ERROR 1064 (42000) You have an error in your SQL syntax; check the manual that corresponds to your

ERP生产作业控制 金蝶

扫雷小游戏——C语言

【云原生】DevOps(五):集成Harbor

Two address pools r2 are responsible for managing the address pool r1 is responsible for managing dhcp relays
随机推荐
prompt.ml/15中<svg>标签使用解释
Interview | Cheng Li, CTO of Alibaba: Cloud + open source together form a credible foundation for the digital world
ERROR 1064 (42000) You have an error in your SQL syntax; check the manual that corresponds to your
MySQL database addition, deletion, modification and query (detailed explanation of basic operation commands)
Industry landing presents new progress | 2022 OpenAtom Global Open Source Summit OpenAtom OpenHarmony sub-forum was successfully held
C language from entry to such as soil, the data store
npm、nrm两种方式查看源和切换镜像
打造基于ILRuntime热更新的组件化开发
volatile内存语义以及实现 -volatile写和读对普通变量的影响
el-image标签绑定点击事件后没有有用
STM32HAL library modifies Hal_Delay to us-level delay
【debug锦集】Expected input batch_size (1) to match target batch_size (0)
从零开始,一镜到底,纯净系统搭建除草机(Grasscutter)
重磅 | 开放原子校源行活动正式启动
WeChat applet uses cloud functions to update and add cloud database nested array elements
C Implementation of Simple Network File Copy
开放原子开源基金会秘书长孙文龙 | 凝心聚力,共拓开源
【R语言】【3】apply,tapply,lapply,sapply,mapply与par函数相关参数
BUG消灭者!!实用调试技巧超全整理
Understanding of the presence of a large number of close_wait states