CentOs7 fails to connect to mysql remotely, access denied for user root@xxx

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.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325185946&siteId=291194637