Solution:
1. Change the table method. It may be that your account does not allow remote login, only localhost. At this time, as long as you log in to mysql on the computer at localhost, change the "host" item in the "user" table in the "mysql" database from "localhost" to "%"
mysql -u root -pvmwaremysql>use mysql; mysql>update user set host = '%' where user = 'root'; mysql>select host, user from user;
2. Authorization method. For example, you want myuser to connect to the mysql server from any host using mypassword.
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
If you want to allow user myuser to connect to the mysql server from the host with ip 192.168.1.3 and use mypassword as password
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION