1. Disable the mysql service.
# Service mysql stop
If an error message such as mysql: unrecognized service is displayed.
First, check for mysql. server and use: find/-name "mysql. server"
Run the/usr/local/mysql/share/mysql. server stop command to disable mysql.
2. Start mysql in security mode to skip the authorization table.
First, check the mysqld_safe program. You can use the find/-name "mysqld_safe" command to find the program. It is in the mysql installation directory by default.
# Find/-name "mysqld_safe"
Start mysql in security mode to skip the authorization table
3. log on to mysql with the root account and change the password to re-authorize
Create a connection to log on to the ECS
1) first enter the mysql-u root command to log on to mysql
2) Enter update mysql. user set password = PASSWORD ('000000') where User = 'root'; update mysql password to 123456789
3) quit mysql
4. Restart the mysql service.
1) killall mysqld ends all mysql Processes
2) service mysql start mysql
3) Press enter from mysql-u root-p and enter the password, which is the mysql password you just reset.