Knowledgebase
Portal Home > Knowledgebase > Cpanel > How to connect to the MySQL database
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.
- Login to cPanel and click the Remote MySQL icon, under Databases.
- Type in the connecting IP address, and click the Add Host button.
- All done, try connecting remotely.
|
Add to Favourites
Print this Article
|
Also Read
Powered by WHMCompleteSolution