Before using either of the following techniques, you will need to open up port 3306 in your server’s firewall.
You will need to add any IP address you will be connecting to MySQL from to the Access Hosts list in cPanel >> Databases >> Remote MySQL. This interface controls which remote hosts are allowed to connect to databases on the cPanel account remotely.