Connecting Scripts to MySQL Databases
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 the use of a configuration file. If you are unsure where your configuration file is, check this list of different scripts to find its location: Location of Script Configuration Files.
Database-driven scripts, such as WordPress, WHMCS, 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:
Hostname = localhost (literally put localhost)
Database name = (cpanelUsername_databaseName)
Database username = (cpanelUsername_databaseUsername)
Database password = (whatever you picked)
Username = joe1337 , Database name = joe1337_wrdp1 , Database-user name = joe1337_wp1 , Database-user password = eHTb7%Pxa9
// ** MySQL Settings ** // /** The name of the database for WordPress */ define('DB_NAME', 'joe1337_wrdp1'); /** MySQL database username */ define('DB_USER', 'joe1337_wp1'); /** MySQL database password */ define('DB_PASSWORD', 'eHTb7%Pxa9'); /** MySQL hostname */ define('DB_HOST', 'localhost');
The database user name cannot be changed to something on shared servers without the cPanel user name. This is to keep database names and usernames from conflicting with other people on the server.