当前位置:网站首页>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
边栏推荐
- Is it safe for Guosen Securities to open an account online?
- 深度學習 卷積神經網絡(CNN)基礎
- C application interface development foundation - form control (6) - menu bar, toolbar and status bar controls
- MySql的root密码忘记该怎么找回
- 成功入职百度月薪35K,2022Android开发面试解答
- UWB ultra wideband positioning technology, real-time centimeter level high-precision positioning application, ultra wideband transmission technology
- Add data to excel small and medium-sized cases through poi
- Worthy of being a boss, byte Daniel spent eight months on another masterpiece
- Analysis of openh264 decoded data flow
- sun.misc.BASE64Encoder报错解决方法[通俗易懂]
猜你喜欢
acm入门day1
Jvmrandom cannot set seeds | problem tracing | source code tracing
Add data to excel small and medium-sized cases through poi
Millimeter wave radar human body sensor, intelligent perception of static presence, human presence detection application
深度学习 卷积神经网络(CNN)基础
软件测试是干什么的?学习有啥要求?
No matter how busy you are, you can't forget safety
Parler de threadlocal insecurerandom
C application interface development foundation - form control (5) - grouping control
如何安全快速地从 Centos迁移到openEuler
随机推荐
成功入职百度月薪35K,2022Android开发面试解答
C application interface development foundation - form control (5) - grouping control
【无标题】
Android interview classic, 2022 Android interview written examination summary
深度学习 卷积神经网络(CNN)基础
Jvmrandom cannot set seeds | problem tracing | source code tracing
完爆面试官,一线互联网企业高级Android工程师面试题大全
The city chain technology Digital Innovation Strategy Summit was successfully held
Cocos2d-x项目总结中的一些遇到的问题
Securerandom things | true and false random numbers
third-party dynamic library (libcudnn.so) that Paddle depends on is not configured correctl
leetcode刷题:二叉树13(相同的树)
leetcode刷题:二叉树16(路径总和)
Is it safe for Guosen Securities to open an account online?
Common - Hero Minesweeper
That's awesome. It's enough to read this article
安信证券在网上开户安全吗?
SecureRandom那些事|真伪随机数
What is the function of okcc call center
【C语言】字符串函数及模拟实现strlen&&strcpy&&strcat&&strcmp