HOW TO ACCESS YOUR DATABASE REMOTELY ON A CPANEL HOSTING
First of all, it is important to explain how the database/database user names are formed. The names consist two parts — your cPanel username and the actual database/username name. For example — if your username is “user” and if you named your database “databasename” you should use:
Same for database username:
So, if you would like to access your database remotely you should add your IP to remote hosts list firs. This could be done via you cPanel -> MySQL database. You will see on the bottom of your page Access Hosts section.
You can see your IP at https://www.whatismyip.com. If you have dynamic IP address you can add % instead which will allow connections from every IP.
To add a group of servers or an IP range you can use:
%.domain.com or 192.168.1.% for example.
As soon as you have your IP added you can access your database using the following information:
MySQL host: your doamin name or the server hostname/IP address
MySQL port: 3306 ( 99% chance to be 3306)
MySQL database: user_databasename
MySQL name: user_databaseuser
MySQL password: the password for the database applied for the user.
If you do not know the user and the password for your database you can always add a new one. This could be done via your cPanel -> MySQL database. Simply create a new user under the Current Users section and add it to the desired database with all privileges.