mysql -u root -p
Enter the database password corresponding to root and enter mysql
USE mysql;
SELECT 'host' FROM USER WHERE USER='root';
UPDATE USER SET HOST = '%' WHERE USER ='root';
FLUSH PRIVILEGES;
The first sentence is to log in as the privileged user root
The second sentence: select the mysql library
The third sentence: Check the host value of the user table in the mysql library (that is, the host/IP name for connection access) The
fourth sentence: Modify the host value (add the host/IP address with the wildcard %), of course, you can also directly Add the fifth sentence of the IP address
: Refresh the MySQL system privilege related table