Turn on MySQL remote access permission
The default MySQL user does not have remote access permission, so when the program is not on the same server as the database, we need to turn on MySQL remote access.
There are two main ways to change the table method and the authorization law.
Relatively speaking, it is easier to change the table method, the individual is also more inclined to use this method, so, here only to paste the table method
1. Log in to MySQL
Mysql-u root-p
2. Modify the user table of the MySQL library and change the host entry from localhost to%. % here is to allow any host access, if only one IP access, you can change to the corresponding IP, such as can be changed to 192.168.1.123, this means that only allow LAN 192.168.1.123 this IP remote access to MySQL.
mysql> use MySQL;
mysql> Update user Set host = '% ' where user = ' root ';
Mysql> Select Host, user from user;
mysql> flush Privileges;
Firewall Open 3306 Port
Modify MySQL permissions to allow host access