I am trying to remotely connect to SQL from another website. I did a whois lookup to get the IP address of the domain that's trying to connect and whitelisted it in cPanel. I also did a
You need to white-list the main IP of the server (on where the domain is hosted). The outgoing connection from the server goes via primary IP address of the server. If it's a Linux machine you can use the command
hostname -i to find out the primary IP address. Also you can check which IP is establishing connection to the MySQL using the command
tcpdump -n dst 18.104.22.168 and port 3306
Change the port number & IP address according to the MySQL server.