当前位置:网站首页>数据库系统原理与应用教程(004)—— MySQL 安装与配置:重置 MySQL 登录密码(windows 环境)
数据库系统原理与应用教程(004)—— MySQL 安装与配置:重置 MySQL 登录密码(windows 环境)
2022-07-01 16:14:00 【睿思达DBA_WGX】
数据库系统原理与应用教程(004)—— MySQL 安装与配置:重置 MySQL 登录密码(windows 环境)
如果忘记 root 用户的登录密码导致 root 用户无法登录 MySQL,可以采用如下解决方法。
方法一:启动 MySQL 服务时跳过安全检查
1、停止 MySQL 服务(以管理员身份运行命令行窗口)

2、启动 MySQL 服务时跳过安全检查

3、另外打开一个窗口,使用空密码登录 root 账号,如下图所示。

4、重新设置 root 账号密码,如下图所示。

5、终止 mysqld.exe 进程,重新启动 MySQL 服务,使用新密码登录系统,如下图所示。

方法二、修改 MySQL 的配置文件
1、停止 MySQL 服务,如下图所示。

2、修改 MySQL 的配置文件 my.ini,如下图所示。

3、在 my.ini 文件的 【MySQLd】部分加入:skip-grant-tables,如下图所示。

4、保存 my.int 文件,启动 MySQL 服务,如下图所示。

5、登录 MySQL,使用空密码登录,如下图所示。

6、把 root 账户的密码修改为 123456

7、停止 MySQL 服务

8、修改 my.ini 文件,删除其中的内容:skip-grant-tables

9、启动 MySQL 服务,使用新密码登录系统

边栏推荐
- Go 语言怎么优化重复的 if err != nil 样板代码?
- IM即时通讯开发万人群聊消息投递方案
- In the past six months, it has been invested by five "giants", and this intelligent driving "dark horse" is sought after by capital
- 部门来了个拿25k出来的00后测试卷王,老油条表示真干不过,已被...
- 【Hot100】19. Delete the penultimate node of the linked list
- 如何使用phpIPAM来管理IP地址和子网
- Can't global transactions be used when shardingjdbc is used in seate?
- Principle of motion capture system
- Nuxt. JS data prefetching
- 2022-07-01日报:谷歌新研究:Minerva,用语言模型解决定量推理问题
猜你喜欢

Do280 management application deployment - pod scheduling control

Research on multi model architecture of ads computing power chip

芯片供应转向过剩,中国芯片日产增加至10亿,国外芯片将更难受

The sharp drop in electricity consumption in Guangdong shows that the substitution of high-tech industries for high-energy consumption industries has achieved preliminary results

学会了selenium 模拟鼠标操作,你就可以偷懒点点点了

Pico, do you want to save or bring consumer VR?

复杂度相关OJ题(LeetCode、C语言、复杂度、消失的数字、旋转数组)

韩国AI团队抄袭震动学界!1个导师带51个学生,还是抄袭惯犯

How to use MySQL language for row and column devices?

I'm a senior test engineer who has been outsourced by Alibaba and now has an annual salary of 40w+. My two-year career changing experience is sad
随机推荐
圈铁发音,动感与无噪强强出彩,魔浪HIFIair蓝牙耳机测评
ATSs: automatically select samples to eliminate the difference between anchor based and anchor free object detection methods
What is the forkjoin framework in the concurrent programming series?
Action after deleting laravel's model
2022 Moonriver global hacker song winning project list
Motion capture system for apple picking robot
如何使用phpIPAM来管理IP地址和子网
Telecommuting experience? Let's introduce ourselves ~ | community essay solicitation
Crypto Daily: Sun Yuchen proposed to solve global problems with digital technology on MC12
picgo快捷键 绝了这人和我的想法 一模一样
SQLServer查询: a.id与b.id相同时,a.id对应的a.p在b.id对应的b.p里找不到的话,就显示出这个a.id和a.p
Example of vim user automatic command
瑞典公布决定排除华为5G设备,但是华为已成功找到新出路
2023 spring recruitment Internship - personal interview process and face-to-face experience sharing
学会了selenium 模拟鼠标操作,你就可以偷懒点点点了
STM32F1与STM32CubeIDE编程实例-PWM驱动蜂鸣器生产旋律
德国iF多项大奖加冕,这副耳机有多强?音珀GTW 270 Hybrid深度评测
实现数字永生还有多久?元宇宙全息真人分身#8i
电脑照片尺寸如何调整成自己想要的
IM即時通訊開發實現心跳保活遇到的問題