当前位置:网站首页>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开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦
边栏推荐
- three.js make 3D photo album
- 问题7:列表的拼接
- MATLAB/Simulink & & STM32CubeMX tool chain completes model-based design development (MBD) (three)
- 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
- mysql基础知识(二)
- ENSP, VLAN division, static routing, comprehensive configuration of Layer 3 switches
- 开源社区三十年 | 2022开放原子全球开源峰会开源社区三十年专题活动圆满召开
- idea工程明明有依赖但是文件就是显示没有,Cannot resolve symbol ‘XXX‘
- volatile内存语义以及实现 -volatile写和读对普通变量的影响
- The MySQL database installed configuration nanny level tutorial for 8.0.29 (for example) have hands
猜你喜欢
View source and switch mirrors in two ways: npm and nrm
【R语言】【3】apply,tapply,lapply,sapply,mapply与par函数相关参数
Knowledge Distillation 7: Detailed Explanation of Knowledge Distillation Code
The third is the code to achieve
【wpf】wpf中的那些模板之深度解析
高等数学---第九章二重积分
[Linear Neural Network] softmax regression
Unity Fighter
(8) Math class, Arrays class, System class, Biglnteger and BigDecimal classes, date class
From scratch, a mirror to the end, a pure system builds a grasscutter (Grasscutter)
随机推荐
ERROR 1064 (42000) You have an error in your SQL syntax; check the manual that corresponds to your
Visual studio shortcuts that improve efficiency, summary (updated from time to time)
MySQL数据库必会的增删查改操作(CRUD)
Fusion Cloud Native, Empowering New Milestones | 2022 Open Atom Global Open Source Summit Cloud Native Sub-Forum Successfully Held
强化学习:从入门到入坑再到拉屎
.NET-6.WinForm2.NanUI学习和总结
Doris学习笔记之监控
【py脚本】批量二值化处理图像
【C语言进阶】文件操作(一)
C语言表白代码?
STM32HAL库修改Hal_Delay为us级延时
WPF WPF 】 【 the depth resolution of the template
微软 AI 量化投资平台 Qlib 体验
open failed: EACCES (Permission denied)
MySQL database addition, deletion, modification and query (detailed explanation of basic operation commands)
微信小程序使用云函数更新和添加云数据库嵌套数组元素
Learning DAVID Database (1)
关于出现大量close_wait状态的理解
unity2d game
30 Years of Open Source Community | 2022 Open Atom Global Open Source Summit 30 Years of Open Source Community Special Event Held Successfully