There was a problem loading the comments.

I Can't Connect to my MySql Database

Support Portal  »  Knowledgebase  »  Viewing Article

  Print
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');


Share via
Did you find this article useful?  

Related Articles

© HostPresto!