当前位置:网站首页>How to retrieve the root password of MySQL if you forget it
How to retrieve the root password of MySQL if you forget it
2022-07-05 19:55:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
Windows Next if MySQL I forgot the password root Unable to login due to password , As shown in the figure below ,
What to do at this time , Only reset root It's a password .
1. Open the task manager to view MySql Whether the service starts , If it has been started, stop it first
2. find MySql In the catalog my.ini file
3. Open the file , Find the inside [mysqld], Then add skip-grant-tables, Save the file after adding
4. Re entering the task manager will MySQL The service starts up
5. Run as administrator cmd
Note that you must run as an administrator in this way cmd, Out-of-service win+R Input cmd function , Otherwise “’mysql’ Not an internal or external command , Nor are they runnable programs or batch files ” Error of .
6. Input mysql -u root -p You can log in without a password , appear password: You can enter when you enter .
7. Get into mysql database :
mysql> use mysql;Database changed
8. to root The user sets a new password :mysql> update user set password=password(“123456″) where user=”root”;
Tips :Query OK, 1 rows affected (0.04 sec)Rows matched: 1 Changed: 1 Warnings: 0
PS:123456 For new password , Users can change their password according to their own needs
9. Before opening my.ini File will be added ”skip-grant-tables“ This line is deleted
10. Open Task Manager and restart MySQL service . Then we can use the password we just set “123456” Connected to the database .
Mysql Of root Password changed successfully !
Additional explanation !!!
The last step update user set password=password(“root”) where user=”root”; Only applicable to 5.5 edition ; 5.7 The version should put the first password Change the field to authentication_string; The result is update user set authentication_string=password(“123456″) where user=”root”
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/149933.html Link to the original text :https://javaforall.cn
边栏推荐
- 中金财富在网上开户安全吗?
- 期货如何网上开户?安不安全?
- 深度學習 卷積神經網絡(CNN)基礎
- 浮动元素与父级、兄弟盒子的关系
- C#应用程序界面开发基础——窗体控制(6)——菜单栏、工具栏和状态栏控件
- Add data to excel small and medium-sized cases through poi
- Go language learning tutorial (16)
- Fundamentals of shell programming (Part 8: branch statements -case in)
- What do software test engineers do? How about the prospect of treatment?
- S7-200smart uses V90 Modbus communication control library to control the specific methods and steps of V90 servo
猜你喜欢

How to safely and quickly migrate from CentOS to openeuler

Autumn byte interviewer asked you any questions? In fact, you have stepped on thunder

third-party dynamic library (libcudnn.so) that Paddle depends on is not configured correctl

acm入门day1

Redis cluster simulated message queue

城链科技数字化创新战略峰会圆满召开

aggregate

leetcode刷题:二叉树11(平衡二叉树)
![[OBS] qstring's UTF-8 Chinese conversion to blog printing UTF-8 char*](/img/cc/172684664a9115943d45b0646ef110.png)
[OBS] qstring's UTF-8 Chinese conversion to blog printing UTF-8 char*

Securerandom things | true and false random numbers
随机推荐
四万字长文说operator new & operator delete
BZOJ 3747 POI2015 Kinoman 段树
[OBS] qstring's UTF-8 Chinese conversion to blog printing UTF-8 char*
CADD课程学习(7)-- 模拟靶点和小分子相互作用 (半柔性对接 AutoDock)
通过POI追加数据到excel中小案例
leetcode刷题:二叉树12(二叉树的所有路径)
【无标题】
软件测试是干什么的?学习有啥要求?
《乔布斯传》英文原著重点词汇笔记(十二)【 chapter ten & eleven】
third-party dynamic library (libcudnn.so) that Paddle depends on is not configured correctl
成功入职百度月薪35K,2022Android开发面试解答
acm入门day1
Go language learning tutorial (XV)
Cocos2d-x项目总结中的一些遇到的问题
【合集- 行业解决方案】如何搭建高性能的数据加速与数据编排平台
Parler de threadlocal insecurerandom
图嵌入Graph embedding学习笔记
openh264解码数据流向分析
Wildcard selector
众昂矿业:2022年全球萤石行业市场供给现状分析