You may have set a MySQL password just now, but forget it when you go out to eat or pick up a package... Should we panic at this time? ? ? ? Don't worry, brothers, I will solve your troubles of forgetting passwords~ The following is a summary of the video of Teacher Lin Haifeng You can think of MySQL's function of obtaining username and password verification as a decorator in Python, which is decorated on the function that the client requests access. If we remove this decorator, the MySQL server will not verify the username and password! ! ! ! # 1. First shut down the current MySQL server. # Start by command (let MySQL skip the username and password verification function) # mysqld --skip-grant-tables # Start on the server and open cmd as an administrator # 2. Connect directly without a password # mysql -uroot -p and press Enter # 3. Modify the password of the current user. # The user information is stored in user.frm in the mysql folder. # update mysql.user set password=password(new password) where user='root' and host='localhost'; ''' The field that actually stores the password of the user table must be stored in ciphertext. Only the user himself knows what the plaintext is, and no one else knows it. This is more secure. Password comparison can only compare ciphertext. MySQL calls the password() method to encrypt the password.''' # 4. Immediately flush the modified data to the hard disk # flush privilege; # 5. Close the current server and then start it in the normal way of verifying the authorization table Click Start and then click Restart. Reopen a normal cmd to start mysql and enter the new password This is the end of this article about how to solve the problem of forgetting the MySQL database password. For more information about forgetting the MySQL password, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Json advantages and disadvantages and usage introduction
>>: Introduction to root directory expansion under Linux system
Table of contents Why use setState Usage of setSt...
This article introduces the sample code of CSS3 t...
Table of contents 1. js statement Second, js arra...
Preface In daily development, we often need to pe...
Preface During the development process, we often ...
Preface In the development of actual projects, we...
Table of contents 1. Introduction to jQuery 2. jQ...
Table of contents The order in which MySQL reads ...
What is a generator? A generator is some code tha...
This article example shares the specific code of ...
This article uses an example to describe the simp...
Get ip tool import lombok.extern.slf4j.Slf4j; imp...
Table of contents What is multi-environment confi...
1. Enter the following address in the browser htt...
Vue card flip carousel display, while switching d...