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: Click the option ‘Remote MySQL’ under the section Databases
Step 3: Enter the IP address or hostname and click the option ‘Add host’