Unable to connect to MySQL throughly a remote client
Hi,
I am trying to connect to the MySQL DB on cPanel with MySQLWorkbench application (running on my laptop). In connection string I used 'Shared IP Address' for hostname, 3306 for port and database username & password.
I have also whitelisted my laptop IP address as well as whitelisted for whole world using '%' under 'Remote MySQL'. I even added my laptop IP address in WHM portal under 'Additional MySQL® Access Hosts'.
But still I am unable to make successful connection to the DB. Error I get is as below
mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on '3.21.191.238:3306' (60 Operation timed out)
Please suggest a solution for this issue.
Thanks
-
Access to TCP 3306 is probably blocked in the actual firewall (likely CSF). So you not only need to allow your remote IP in cPanel, but you need to make sure your IP is allowed to access TCP 3306 remotely according to firewall rules. If you are on a shared server, your hosting provider may not allow remote SQL connections or may require you to open a ticket to request your IP to be added for access through the firewall. Since you are on Amazon, they might have a firewall interface where you have to allow your IP to access TCP 3306 of the server IP.
0 -
Thanks mtindor . Pardon my limited knowledge with setting servers and network config, but how does AWS firewall comes into picture here? MySQL db is (I believe) hosted on cPanel server and they have their own Firewall.
0 -
I didn't say AWS firewall definitely comes into the picture, but I said it may. I don't use AWS. I often use Digital Ocean though. And I know at Digital Ocean you have whatever firewall that you've installed on your machine, AND you have the ability to also apply a Digital Ocean firewall. Same on Azure.
Bottom line is that some firewall, whether it is CSF on your server, or an external firewall such AWS Firewall if such thing exists and is enabled to protect your server, is blocking TCP 3306 from your IP address. You need to allow your IP through that firewall.
And it is possible to have both CSF and an external firewall functioning. On my DNSOnly servers, I not only use CSF but I also use Digital Ocean Firewall, just as an example.
0
Please sign in to leave a comment.
Comments
3 comments