Solution:
1. Change the table. It may be that your account is not allowed to log on remotely, but only on localhost. At this time, you only need to log in to MySQL on the computer of localhost, and change the "host" entry in the "user" table in the "MySQL" database to "%" from "localhost"
Mysql-u root-p123
Mysql> use MySQL;
Mysql> Update user set host = '%' where user = 'root ';
Mysql> select host, user from user;
2. Authorization method. For example, if you want Kevin to use mypassword to connect to the MySQL server from any host.
Grant all privileges on *. * To 'kevin '@' % 'identified by 'mypassword' with grant option;
If you want to allow user Kevin to connect to the MySQL server from a host with IP address 192.168.101.234, and use mypassword as the password
Grant all privileges on *. * To 'kevin '@ '192. 168.101.234' identified by 'mypassword' with grant option;
3. if this is the case, it will not work. (generally, it will work in windows) modify the following configuration file. (in Linux, you can find the corresponding configuration file under your MySQL installation directory)
VI/etc/MySQL/My. CNF
Comment out
# Bind-address = 127.0.0.1