I finished learning SQL by myself not long ago, and downloaded MySQL 8.0.17. After installing and configuring it, I explored it and wondered if I could delete the root account by logging in with the root account. Then I wanted to slap myself... How to quickly restore root: 1. Close the MySQL service: press win+R, type services.msc, find the MySQL service, and click stop; 2. Delete the data folder and its files: Enter the mysql folder, find the data folder and delete it; 3. Initialize mysql: Enter services.msc again and run the mysql service; enter the mysql\bin file path in the cmd window and run mysqld --initialize --console. The result is similar to the following:
Note that the bold statement contains the temporarily generated root account password; 4. Run mysql in cmd: type 5. Modify the temporary root password: Run the SQL statement: alter 6. Check whether the query is successful: Run the SQL statement: Note: Although this method is quick and effective, it will delete all database files, that is, the databases in the data folder. I have tried adding skip-grant-tables to bypass login authentication, but it is not effective for version 8.0.17. Summarize The above is what I introduced to you on how to recover the deleted Mysql8.0.17 Root account and password under Windows. I hope it will be helpful to you! You may also be interested in:
|
<<: JavaScript to achieve calendar effect
>>: Detailed steps for installing, configuring and uninstalling QT5 in Ubuntu 14.04
Practice is the only way to test the truth. This ...
Background of the problem The server monitoring s...
Today, I will record how to install MySQL 8.0.18 ...
Preface A character set is a set of symbols and e...
Problem description: Error message: Caused by: co...
Solution to forgetting MySQL password: [root@loca...
inherit 1. What is inheritance Inheritance: First...
The complete syntax of the select statement is: S...
How to write join If you use left join, is the ta...
Preface This article will explain how Vue compone...
Sometimes some docker containers exit after a per...
1. Simple configuration of nginx's dynamic an...
Recently, when I installed MySQL in Docker, I fou...
Two implementations of Vue drop-down list The fir...
In the process of database operation, it is inevi...