I Can't Connect to my MySql Database

It is important to ensure that your website has the right MySQL database connection information set in your website's code, otherwise your website will not be able to create a successful database connection. * * * ### Configuration Settings * Host name = localhost _(literally put localhost)_ * Database name = (cpanelUsername_databaseName) * Database username = (cpanelUsername_databaseUsername) * Database password = (the password you picked) * * * ### Code example With the example account settings of: * cPanel username = paul1666 * Database name = wrdp1 * Database username = pauluser * Database user password = 4EtufEch These settings would translate into the following code on your website. ``` // ** MySQL Settings ** // /** The name of the database */ define('DB_NAME', 'paul1666_wrdp1'); /** MySQL database username */ define('DB_USER', 'paul1666_pauluser'); /** MySQL database password */ define('DB_PASSWORD', '4EtufEch'); /** MySQL hostname */ define('DB_HOST', 'localhost'); ``` * * *
  • 0 Користувачі, які знайшли це корисним
Ця відповідь Вам допомогла?

Схожі статті

How to log into cPanel

There are two different methods to log into your cPanel control panel in order to manage every...

What's the difference between Aliases, Addon and Subdomains?

### Aliases An Alias domain does not have a unique website. It is a domain that is masked to...

Creating a MySql Database

If your website uses PHP or you need to hold a collection of records which need to be accessed...

Importing a MySql Database

You can import a MySQL database via phpMyAdmin which is available in the cPanel control panel....

Exporting a MySql Database

You can export a MySQL database via phpMyAdmin, available in cPanel, if you want to keep a backup...