The operation steps are as follows:
1. Login
The command line is as follows:
mysql -u root -p
2. Enter the original password and enter the password
according to the promptEnter password:
3. Execution
update user set host='%' where user ='root';
4. Execution
flush privileges;
5. Execution
use mysql;
6. Execution
select host,user from user;
The display %
means that the modification has been completed, and the error has been resolved.