After installing mysql on the remote server CentOs, an error is reported when connecting remotely:
Enter mysql on the remote host, query: select host, user, Password, grant_priv from user;
It is found that the password for remote access to the database is inconsistent with the password for local access to the database, so update the password:
update user set password=password('123456') where user='root'
Query again select host, user, Password, grant_priv from user;
It is found that the password is the same, wait for two minutes, connect to the database again, and connect successfully.