Two steps are required to remotely connect to MySQL:
The first step is to create a MySQL user that can be remotely connected
Mysql> grant all privileges on remote. * to remote @ "%" identified by "remotepwd ";
Or modify the Host field of an account in the User table to %, % indicates that all hosts can be linked.
Step 2: Modify the MySQL configuration file/etc/MySQL/My. CNF
$> Sudo VI/etc/MySQL/My. CNF
In the old version, locate skip-networking and comment it out.
# Skip-networking
In the new version:
# Instead of skip-networking the default is now to listen only on
# Localhost which is more compatible and is not less secure.
Bind-address = 127.0.0.1
Bind-address = 127.0.0.1 must be commented out.
# Bind-address = 127.0.0.1
Or fill in the IP addresses that are allowed to access
# Bind-address = 192.168.1.100
Restart MySQL
$> Sudo/etc/init. d/MySQL restart
In this way, you can remotely access MySQL.