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
1. Disconnection reason There are many reasons wh...
CentOS6.9 installs Mysql5.7 for your reference, t...
Docker Swarm is a container cluster management se...
The first thing to do is to pick a good browser. ...
The TextBox with the ReadOnly attribute will be di...
Table of contents Overview From Binary Tree to B+...
/******************** * Character device driver**...
Table of contents Bidirectional binding principle...
This article example shares the specific code of ...
Optimize queries Use the Explain statement to ana...
The database enables slow query logs Modify the c...
Table of contents background Solution 1: Back up ...
Table of contents 1. Foreign key constraints What...
For security reasons, MySql-Server only allows th...
This article describes how to build a phalcon env...