Troubleshooting remote connection to MySQL

microvax

Active Member
Mar 4, 2021
32
2
8
Lima
cPanel Access Level
Root Administrator
Hello,
I have enabled remote MySQL connection to one customer's CPanel account for an external developer, however he is telling me that he can't connect, despite having added this IP to the server whitelist.
Is there a place where I could see the MySQL log files in order to find failed connections?
 

cPDavidL

Linux Analyst II
Oct 15, 2012
79
18
133
cPanel Access Level
Root Administrator
Hello!

The MySQL error logs should be in /var/log/mysqld.log or /var/lib/mysql/$hostname.err(where $hostname is the system hostname).

If the client is failing to establish a connection at all, you'll want to check for network connections when they try access. This can be done with netstat, and if necessary tcpdump

With netstat, have the user try to log in, and immediately run:

netstat -anp | grep $usersIP
(set $usersIP as the IP they are connecting from)

Look to make sure the connection is reaching the OS. If not, then check for firewall and/or network issues.