What if centos mysql forgets his password?
This article mainly explains "how to solve the problem of centos mysql forgetting password". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to solve centos mysql forgetting your password".
The solution for centos mysql to forget the password: 1. Add a "skip-grant-tables" to the paragraph of [mysqld]; 2, restart the mysql service; 3, enter "mysql-u root-p"; 4, change the password through update.
The operating environment of this paper: centOS6.8 system, mysql5.5, Dell G3.
How did centos mysql forget the password?
Centos system mysql forgot password
After installing mysql, pay attention to adding soft connections
Mysql forgot password operation
Vim / etc/my.cnf
Add a sentence to the paragraph of [mysqld]:
Skip-grant-tables
Restart the mysql service, service mysql restart
Enter enter mysql-u root-p to enter the mysql database
Use mysql
Lower version modification:
Update user set Password = password ('LDtianzhe.') Where user = 'root'
High version modifications:
Update user set authentication_string=password ('new password') where user =' root'
Vim / etc/my.cnf comment out the restart service added above again to enter the database again.
If this error occurs:
ERROR 1175 (HY000): You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
Need to turn off protected mode
Just use the update password again.
Exit, comment out skip-grant-tables
Just restart the service.
At this point, I believe you have a deeper understanding of "centos mysql forgot password how to solve", might as well come to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!