当前位置:网站首页>MySQL数据库常见故障——遗忘数据库密码
MySQL数据库常见故障——遗忘数据库密码
2022-06-26 12:40:00 【C和弦~】
目录
引言:
在生产环境中因为一些特殊原因会导致我们遗忘登陆mysql数据库的root密码,今天就来解决这个问题。
一.故障现象
遗忘root密码,无法访问数据库

二.故障解决
1.修改配置文件
vim /etc/my.cnf

2.重启服务

3.mysql

4.使用sql语句更改root密码

5.将配置文件中刚刚手动添加的语句删除
vim /etc/my.cnf

6.重启服务

三.故障解决

总结:
遗忘密码解决一共分为6步
- 更改配置文件(添加免密登陆命令)
- 重启服务
- 免密登陆数据库(输入密码哪里直接回车)
- 使用sql语句更改root密码
- 再次进入配置文件(将刚刚手动添加的命令删除)
- 再次重启服务
边栏推荐
- 橋接模式(Bridge)
- Oplg: new generation cloud native observable best practices
- Appearance mode (facade)
- 享元模式(Flyweight)
- 体现技术深度(无法速成)
- Electron official docs series: Examples
- National standard gb28181 protocol easygbs video platform TCP active mode streaming exception repair
- 倍福TwinCAT3实现CSV、TXT文件读写操作
- C# 结构体:定义、示例
- Adapter mode
猜你喜欢

What are the common categories of software testing?

IDC report: the AI cloud market share of Baidu AI Cloud ranks first for six consecutive times

倍福PLC基于CX5130实现数据的断电保持

Oplg: new generation cloud native observable best practices

Enjoy element mode (flyweight)

Record a phpcms9.6.3 vulnerability to use the getshell to the intranet domain control

Decorator

Machine learning notes - seasonality of time series

2. Introduction to parallel interface, protocol and related chips (8080, 8060)

Script - crawl the customized storage path of the cartoon and download it to the local
随机推荐
UVA10341 solve it 二分
map 取值
Design of four kinds of linear phase FIR filters -- complete set of Matlab source code
Record a phpcms9.6.3 vulnerability to use the getshell to the intranet domain control
Angle de calcul POSTGIS
体现技术深度(无法速成)
mariadb学习笔记
Electron official docs series: Examples
OPLG: 新一代云原生可观测最佳实践
scrapy——爬取漫画自定义存储路径下载到本地
倍福EtherCAT Xml描述文件更新和下载
2、并行接口、协议和相关芯片介绍(8080、8060)
. Net Maui performance improvement
postgis 地理化函数
倍福PLC旋切基本原理和应用例程
Uva11582 [fast power]colossal Fibonacci numbers!
Word document export (using fixed template)
Electron official docs series: Examples
H - Sumsets POJ 2229
Electron official docs series: Processes in Electron