Knowledgebase

How to Connect to the MySQL Database in cPanel?  Print this Article

Connect to the MySQL Database in cPanel:

In order for your MySQL database to work as intended, it will need a script calling or querying the database for the information it stores. In order to do this, you must connect your script to the database with a configuration file.

Configuration Settings:

Database driven scripts, such as Wordpress, and Joomla, will generally have a default configuration file ready for you to edit with the appropriate information. Below you will find examples of what this access information will look like:
  • Host Name = localhost (literally input localhost)
  • Database Name = cPanelUsername_databaseName
  • Database Username = cPanelUsername_databaseUsername
  • Database Password = whatever you selected
While it is possible to connect to the database using your cPanel username and password, we NEVER recommend this. Every time you change or reset your cPanel password your databases will stop working until configuration files are updated.

Was this answer helpful?

Also Read

How to Change DNS Zones (MX, CNAME and A Records) in cPanel?
Change DNS Zones (MX, CNAME and A Records) in cPanel: With cPanel, users are granted access to...
How to Redirect a Subdomain to Another Page?
Redirect a Subdomain to Another Page: You can redirect your subdomain to another page by...
How to Upload a File using the File Manager in cPanel?
Upload a File using the File Manager in cPanel: You can upload your files directly through...
I Accidentally Deleted the public_html or www Folder
I Accidentally Deleted the public_html or www Folder: If you delete the www folder, your site...
How Do I Create and Remove an Addon Domain in cPanel?
Create and Remove an Addon Domain in cPanel: An addon domain is a fully functional domain that...