The default remote MySQL connections are disabled in cPanel servers to prevent potential security risks to MySQL server. You can allow Remote MySQL connections either through Web Host Manager (WHM) or through cPanel (for specific databases created under that cPanel account). Open the port 3306 on the server firewall to allow remote MySQL connections in cPanel and ensure it before performing the below steps
Steps to Allow Remote MySQL connection from cPanel
Step 2 Locate the Databases section. Under Databases section locate Remote MySQL option and click on it.
Step 3 In the next screen, enter the hostname or IP address that you want to grant remote MySQL access to and click the Save button. If your IP address changes regularly, you can use wildcard by using the % symbol. This will add all IP addresses in that range. For instance; if you want to list IP addresses range from 192.168.3.1 to 192.168.3.255, you can add an IP address as 192.168.3.%.