After I found that the previous article solved the problem of MySQL service failing to start, I found that I could not log in with the root user without a password. The 5.7 version could not log in with the root user without a password during initialization. After searching many posts, I solved the problem. It turns out that in the .err file in the data file generated by the mysqld –initialize method in the previous article, you can open it with word and there will be a temporary initial password for generating root After opening, find the password: However, this password will expire and cannot be used after being used once. Now let's change this password 1. First shut down the mysql service, net stop mysql 2. Modify your MySQL configuration file my.ini or my-default.int. See which file to modify according to your own configuration. 3. Add skip-grant-tables to the [mysqld] node 4. Start the MySQL service (net start mysql), and use a visual client to enter MySQL. I use the visual client mysqlFront, you can find it on Baidu. 5. Open the user table under MySQL and change the Y in the password_expired field to N. This is mainly to change whether the password is valid. There are two types, Y/N. Y means expired, and n means valid. Remember to save after changing it. 6. Stop the mysql service, delete the skip-grant-tables in the ini file, and restart the service 7. Change password: mysqladmin -u root password root Enter the original password and the change is successful. The last root is the new password The password has been changed successfully and you can log in, mysql -uroot -p Enter the password root you just set to log in 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:
|
<<: Detailed explanation of installing applications in Linux Centos7 without Internet connection
>>: How to use the Clipboard API in JS
By default, PHP on CentOS 7 runs as apache or nob...
This article shares the specific code of js to im...
I was curious about how to access the project usi...
Common scenarios of MySQL: getting the intersecti...
Table of contents Docker images What is a mirror?...
Structural (position) pseudo-class selector (CSS3...
Table of contents 1. Mathematical functions 2. St...
Check what is installed in mysql rpm -qa | grep -...
This is my first blog. It’s about when I started ...
in conclusion % of width: defines the percentage ...
1. System environment The system version after yu...
This article introduces the installation of Windo...
Introduction Today I will share the use of the su...
Table of contents 1. Introduction 2. Preparation ...
As of now, the latest version of CentOS is CentOS...