1. View the IP that the MySQL port allows access to.
netstat-an| grep 3306
If displayed as the following, only native access is allowed.
TCP 0 0127.0. 0.1:3306 0.0. 0.0:* LISTEN
2, modify the/ETC/MYSQL/MYSQL.CONF.D/MYSQLD.CNF, will be inside the
127.0. 0.1
Comment out.
3, terminal login to MySQL, to all remote user authorization (the following two ways to choose one according to the actual situation).
3.1 Authorized for all remote users.
' Root '@'%'123456'; #root为远程登录用户, 123456 is the password for the Telnet user
3.2 Authorized for the specified IP.
GRANT all privileges on * * to [email protected]' specified IP address 'root user password ' with GRANT OPTION;
4. Restart MySQL.
/etc/init.d/mysql restart
5. Re-view the port.
#netstat-an|grep 3306TCP60 0:::3306:::*LISTEN TCP60 0 192.168.4.128:3306 192.168.4.1:53071ESTABLISHEDTCP60 0 192.168.4.128:3306 192.168.4.1:50004Established
Setting up MySQL on Ubuntu can be accessed remotely