Adding remote host access to MySQL server
For security reasons, only local server MySQL connections are allowed by default. However, you do have the option to allow external web servers to access your MySQL databases, this is done by adding the requesting web server domain name to the access hosts list on your website. localhost stands for your own web server and that is in the list by default always.
To add host access:
Click MySQL databases on your Cpanel hosting account control panel.
Enter the remote host domain name or IP address in the Host field.
Click Add Host button and connections from the remote host is now allowed to access the MySQL server.