1. stop mysql service: servicemysqldstop; 2. mysqld_safe -- skip-grant-tables3. repeat an SSH connection (that is, repeat a new black window); 4. enter the following command: [root @ localhost ~] # Mysqlmysqlusemysqlmysqlupdateusersetpasswordpassword (123456) where
1. stop mysql service: service mysqld stop; 2. mysqld_safe -- skip-grant-tables 3. repeat an SSH connection (that is, repeat a new black window); 4. enter the following command: [root @ localhost ~] # Mysql mysqluse mysql mysqlupdate user set password = password (123456) where
1. stop mysql service: service mysqld stop;
2. mysqld_safe -- skip-grant-tables
3. Repeat an SSH connection (that is, repeat a new black window );
4. Enter the following command:
[Root @ localhost ~] # Mysql
Mysql> use mysql
Mysql> update user set password = password ("123456") where user = "root ";
Mysql> flush privileges;
Mysql> exit
Pkill-KILL-t pts/0: force the ** users whose pts is 0 (the user window before mysqld_safe is run) out.
Start MySQL normally: service mysql start.