当前位置:网站首页>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
边栏推荐
- 成功入职百度月薪35K,2022Android开发面试解答
- Reptile exercises (II)
- 中金财富在网上开户安全吗?
- 【obs】libobs-winrt :CreateDispatcherQueueController
- 手机股票开户安全吗?靠不靠谱啊?
- 期货如何网上开户?安不安全?
- 2023年深圳市绿色低碳产业扶持计划申报指南
- UWB ultra wideband positioning technology, real-time centimeter level high-precision positioning application, ultra wideband transmission technology
- C#应用程序界面开发基础——窗体控制(5)——分组类控件
- Where is the operation of new bonds? Is it safer and more reliable to open an account
猜你喜欢
【obs】QString的UTF-8中文转换到blog打印 UTF-8 char*
城链科技数字化创新战略峰会圆满召开
通过POI追加数据到excel中小案例
Go language | 02 for loop and the use of common functions
Millimeter wave radar human body sensor, intelligent perception of static presence, human presence detection application
Redis cluster simulated message queue
如何安全快速地从 Centos迁移到openEuler
浅浅的谈一下ThreadLocalInsecureRandom
Go language | 03 array, pointer, slice usage
S7-200SMART利用V90 MODBUS通信控制库控制V90伺服的具体方法和步骤
随机推荐
C - sequential structure
期货如何网上开户?安不安全?
618 "low key" curtain call, how can baiqiushangmei join hands with the brand to cross the "uncertain era"?
c语言oj得pe,ACM入门之OJ~
Debezium series: parsing the default value character set
Let's talk about threadlocalinsecurerandom
软件测试是干什么的?学习有啥要求?
【合集- 行业解决方案】如何搭建高性能的数据加速与数据编排平台
How about testing outsourcing companies?
Common operators and operator priority
Go language | 02 for loop and the use of common functions
Millimeter wave radar human body sensor, intelligent perception of static presence, human presence detection application
Xaas trap: all things serve (possible) is not what it really needs
Parler de threadlocal insecurerandom
Wildcard selector
Debezium series: idea integrates lexical and grammatical analysis ANTLR, and check the DDL, DML and other statements supported by debezium
处理文件和目录名
Microwave radar induction module technology, real-time intelligent detection of human existence, static micro motion and static perception
【硬核干货】数据分析哪家强?选Pandas还是选SQL
okcc呼叫中心有什么作用