In order to connect MYSQL database remotely (on local machine or other servers), you are required to add IP to the allowed list. By default cPanel will only allow databases connectivity from within the server (for security).
In order to connect MYSQL databases remotely, please follow the steps below:
Please note, all databases within the account will be accessible to the IPs added - IP access cannot be added for databases separately.