Remote MYSQL Access Connection
I recently moved my sites to a new server, on my old server Remote MYSQL worked fine.
All i did was add my ip in the white list in cPanel.
Now with the new server this does not work.
I have added my ip in cPanel Remote Mysql whitelist.
I have added my ip in the Global MYSQL Host list in WHM.
I have also checked the iptabels and i cannot find anything that would block.
The server i run have multiple ips. I have tested to connect to my main servers IP and port 3306
And also the deddicated ip of the cPanel account and port 3306. I get connection Refused when i try from Putty.
Question is
Is there any error log i can check for not allowed connections so i can try find the issue?
Server OS: CENTOS 7.3
This is a short list from iptabels
[root@ns3057874 lib]# iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination
cphulk all -- anywhere anywhere
cP-Firewall-1-INPUT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere tcp dpt:mysql
ACCEPT tcp -- anywhere anywhere tcp dpt:mysql
ACCEPT tcp -- Thisismyhost-no195.tbcn.telia.com anywhere tcp dpt:mysql
Chain FORWARD (policy ACCEPT)
target prot opt source destination
cP-Firewall-1-INPUT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere multiport dports smtp,urd,submission owner GID match mailman
ACCEPT tcp -- anywhere anywhere multiport dports smtp,urd,submission owner GID match mail
ACCEPT tcp -- anywhere localhost.localdomain multiport dports smtp,urd,submission owner UID match cpanel
ACCEPT tcp -- anywhere anywhere multiport dports smtp,urd,submission owner UID match root
cpanel-dovecot-solr all -- anywhere anywhere
-
I have tested to connect to my main servers IP and port 3306 And also the deddicated ip of the cPanel account and port 3306. I get connection Refused when i try from Putty.
Hello, Could you try using the "telnet" command from the remote server that's making the connection to your MySQL service? EX:telnet domain.tld 3306
Does this connection succeed or fail? Also, you may want to try installing a firewall management tool such as CSF and then configuring CSF to allow connections to port 3306 (or adding a specific host or IP to the whitelist): ConfigServer Security & Firewall (csf) Thank you.0 -
Thank you for response I have installed it now, but when i look at listening open ports the 3306 is not displayed. Ports listening for external connections and the executables running behind them: there is no 3306 port here. Do i need to enable it some how? Mysql works fine locally on all sites just not remote but how can it work if port is not listening? 0 -
I found the issue, in /etc/my.cnf i had to remove bind-address=127.0.0.1 Apperently if local adress is binded you cannot connect remotly! Thanks! 0 -
I'm happy to see the issue is now solved. Thank you for updating us with the outcome. 0 -
You can also change it into bind-address=* Then restart MySQL service (service mysql restart) 0
Please sign in to leave a comment.
Comments
5 comments