In Linux, how does one enable mysql remote connection? mysql remote connection linuxserviceserveruserMysql is accessible only to local root users by default, but cannot be remotely connected to and managed mysql databases. how does one enable mysql remote connection in Linux? The procedure is as follows: 1. run the GRANT command to create a remote Linux instance to enable mysql remote connection.
Mysql remote connection linuxserviceserveruserMysql by default, the root user can only access the local database, but cannot remotely connect to and manage the mysql database. how does one enable mysql remote connection in Linux? The procedure is as follows:
1. GRANT command to create a remote connection mysql authorized user test
Mysql-u root-p
Mysql> grant all privileges on *. * TO test @ localhost identified by 'test' with grant option;
Mysql> grant all privileges on *. * TO test @ "%" identified by 'test' with grant option;
In the first sentence, the itlogger user is authorized to access through the local machine (localhost) and the password is 'test '. The second sentence is to authorize the test user to initiate access from any other host (wildcard % ).
2. set the firewall to allow port 3306
Vi/etc/sysconfig/iptables
Add
-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 3306-j ACCEPT
(Note that before-A RH-Firewall-1-INPUT-j REJECT -- reject-with icmp-host-prohibited, otherwise the rule may not take effect)
Restart firewall service iptables restart