wrong reason:
The local IP (xxx.xxx.xxx.xxx) does not have permission to access the remote database.
solve:
This paragraph is a pure solution, explained below
First open the administrator window, and then look directly at the picture below
The code that needs to be used is placed here for easy access
1.mysql -uroot -p
2.use mysql;
3.update user set host = '%' where user = 'root';
4.flush privileges;
5.select user,host from user;
The following is the detailed process
1. Open the administrator window
2. Log in to the mysql server
Enter this statement: mysql -uroot -p, then enter your password
3. Use mysql database
Enter this statement: use mysql;
4. Update user permissions
Enter this statement: update user set host = '%' where user = 'root';
5. Refresh permission, this must have
Enter this statement: flush privileges;
6. Check for success
Enter this statement: select user,host from user;
If root, the corresponding percent sign (%)
congratulations on your success