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 Problem 1: Destruction 1. How t...
Preface When making a top menu, you will be requi...
MySQL's foreign key constraint is used to est...
Table of contents 1. ChildNodes attribute travers...
1. Introduction This article mainly explains how ...
Table of contents environment summary Module Func...
Ⅰ. Problem description: Use CSS to achieve 3D con...
What is an index? Why create an index? Indexes ar...
Disable swap If the server is running a database ...
1. Introduction Presto is an open source distribu...
Will mysql's IN invalidate the index? Won'...
Modify the IP address of the virtual machine: Ent...
Now we can use an attribute of input called autoco...
Introduction to four commonly used MySQL engines ...
If an index contains (or covers) the values of ...