How to Connect to the MySQL Database in cPanel?
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.
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:
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.
- Host Name = localhost (literally input localhost)
- Database Name = cPanelUsername_databaseName
- Database Username = cPanelUsername_databaseUsername
- Database Password = whatever you selected
Was this answer helpful?
Create, Edit or Delete a File Using the File Manager in cPanel: You will need to have a basic...
Create URL Redirect in cPanel:The Redirects tool in cPanel will allow you to redirect your...
Accessing Web Disk and WebDav in cPanel: Web Disk (also known as WebDAV) is a drag-and-drop...
PHP Configuration Plugin in cPanel: If you ever encounter problems with the way your server...
Document Root Folder: The document root is the folder where the website files for a domain name...