By default, databases only accept connections from the server itself. That is deliberate: it means a stolen password is useless to someone outside. You can allow remote access if you need it.
Allowing your address
In cPanel open Remote MySQL and add your own IP address. Find it by searching for "what is my IP".
The catch
Most home and small office connections have an address that changes. When yours changes, the access stops working and you have to add the new one. That is not a fault.
Never use the wildcard
Remote MySQL will accept % as an address, meaning "anywhere in the world". Do not do this. It exposes your database to every automated password-guessing attempt on the internet, permanently. If you find % in that list, remove it.
Connection details
- Host – your domain name, or the server hostname
- Port – 3306
- Username and password – the database user, not your cPanel login
A safer alternative
If you have SSH access, tunnel the connection through it rather than opening the database port at all. Your database client connects to a local port which is forwarded over the encrypted SSH session. Nothing is exposed publicly and it works from any address.
For occasional use
If you only need to look at the data now and then, phpMyAdmin in cPanel avoids all of this.