1. Check whether the MySQL service is started. If it is started, shut down the MySQL service. Run the command: ps -ef | grep -i mysql If it is open, run the shutdown command: service mysqld stop 2. Modify the mysql configuration file my.conf Generally, in the /etc directory, run the command: vi /etc/my.cnf to edit the file Add a sentence under the [mysqld] tag in the file: skip-grant-tables Then press wq! to save and exit. 3. Restart the database Run the command: service mysqld start 4. Restart the database Run the command: service mysqld start 5. Enter the mysql database Run the command: mysql -u root 6. Enter the mysql database Run the command: mysql -u root 7. Change password Here is how 5.6 does it
Here is how 5.7 does it
8. Delete what was added in step 2, restart the server, and then you can log in to the server using the password you just changed. mysql -u root -p At this point, everything is finished. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Details on how to write react in a vue project
>>: How to use mysqldump for full and point-in-time backups
Table of contents 1. Basic Concepts of GTID 2. GT...
When I first started designing web pages using XH...
Basics The matching order of location is "ma...
This article introduces MySQL string interception...
Find the problem I recently migrated the storage ...
Table of contents 1. What is a window function? 1...
Install the unzipped version of Mysql under win10...
This article shares the specific code of JS canva...
Table of contents 1. Introduction 2. Use 1. @Comp...
1. Check the character set of the database The ch...
1. HTML Overview 1.HTML: Hypertext Markup Languag...
For a website, usability refers to whether users c...
Table of contents Overview Code Implementation Su...
CSS3 implements 2D plane transformation and visua...
Using Technology itext.jar: Convert byte file inp...