How to connect to the MySQL database

Configuration Settings:
Host = localhost (really, put localhost)
Database name = (cpanelusername_databasename)
Database username = (cpanelusername_databaseusername)
Database password = (******)

Note: When you move databases to our servers, the database name and username may change. This change must be updated in your script code. (The database name and username is clearly displayed in cPanel, in the MySQL area.)

On shared servers, the database user name cannot be changed to something without the cPanel user name in it.

It is possible for someone to use their cPanel username and password to connect to the database. However, we NEVER recommend doing this because the first time you change or reset your cPanel password, then your databases will stop working.


How to connect to the MySQL server remotely

Configuration Settings:
Host = (use the server IP address)
Database name = (cpanelusername_databasename)
Database username = (cpanelusername_databaseuser)
Database password = (******)
MySQL Connection Port = 3306
TCP or UDP, either is fine.

Before you can connect to MySQL from another computer, you must enable your computer as an access host. It may sound confusing, but cPanel makes this very simple.

  1. Login to cPanel and click the Remote MySQL icon, under Databases.
  2. Type in the connecting IP address, and click the Add Host button.
  3. All done, try connecting remotely.

Wait a minute, my IP constantly changes.
Okay, you have a dynamic IP address. Therefore, every time you go online, or every once in awhile, your IP changes. You have a few options here. The most secure, would be to update your IP in Remote MySQL every time your IP changes. However, you do have other options available. You could simply enter % (a percentage sign) in the Add Access Hosts text field. This will allow any IP to remotely connect to your databases. Another option: Lets say the first two parts of your IP never change. Then, you could enter 93.138.%.% , where the first two parts are your actual IP address numbers.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to redirect a subdomain to another page

You might want your sub domain to redirect to another page. To do this, please do the following:...

How to change the password of your cPanel account

There may be times where you would like to change the password of your account. It is recommended...

Error Page Codes

What are Error Codes?These numbered error codes are how the server tells website visitors about...

How to generate/download a full backup

A full backup is a backup of all of your files, e-mail, databases, etc. To run a full backup,...

Latest Visitors

You will find an icon for this in cPanel, under the Logs section. This function will show the...