In Linux, the configuration of MySQL remote access settings is described a lot on the Internet, but the actual operation is still a lot of trouble, record it (Red is worth noting ).
In Linux, the configuration of MySQL remote access settings is described a lot on the Internet, but the actual operation is still a lot of trouble, record it (Red is worth noting ).
In Linux, the configuration of MySQL remote access settings is described a lot on the Internet, but the actual operation is still a lot of trouble, record it (Attention should be paid to the red area.).
The first step is the same as configuring mysql remote logon in Winddows. Generally, You can execute the following statement:
In fact, you have created a User Username: admin Password: admin to log on remotely.
Step 2: Open the Firewall
It is not easy to simply close the firewall.
Stop the Firewall service iptables stop and then modify/etc/sysconfig/iptables
Add-A input-m state -- state NEW-m tcp-p tcp -- dport 3306-j ACCEPT
Note that the added location must be in
-A input-j REJECT -- reject-with icmp-host-prohibited
-A forward-j REJECT -- reject-with icmp-host-prohibited
Above.
Then start the Firewall:
Service iptables start
If the problem persists, modify the following configuration:/etc/my. cnf.
[Mysqld] add
Skip-name-resolve
If the my. cnf file cannot be found, copy the my-small.cnf to/etc and rename my. cnf.
Do not know the location of the my-small.cnf with find/-name my-small.cnf