Wordpress: Error establishing database connection issues

If you’ve uploaded Wordpress onto your hosting account and it isn’t working or if you get ‘Error establishing database connection issues’ when you try to visit your website, it might be that your Database log in credentials are incorrect in the wp-config.php file. To fix this problem, follow the instructions below:

  • FTP connect to your hosting account using your account FTP details
  • Open the wp-config.php file (located in the root folder)
  • Make sure your database name, username, password and hostname are correct (you can find instructions below depending on your hosting)
  • Find the database string below in the wp-config.php file and replace the bold sections with the correct information
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'Database Name');

/** MySQL database username */
define('DB_USER', 'Username');

/** MySQL database password */
define('DB_PASSWORD', 'Password');

/** MySQL hostname */
define('DB_HOST', 'Hostname');

  • Re-upload the edited wp-config.php file

Cloud Hosting:

To find your database name, hostname, username and password:

  1. Log into the Console
  2. Click the domain you want to manage
  3. Click Database and you will see your database under the Current Databases heading
  4. Click View under Credentials
  5. In the pop up you'll find log in information and your hostname

cPanel Hosting:

  1. Log into the Console
  2. Click the domain you want to manage
  3. Click cPanel Hosting
  4. Under hosting settings, click Log into cPanel interface
  5. Under the Databases section click MySQL Databases
  6. On this page you’ll find the database name
  7. Scroll down to Current Users and your will find the database user which will connect to the database
  8. In the Current Users section you can reset your database user password

For cPanel users the hostname is always localhost

Success! You’ve done the steps for this article. If you’re unable to follow these steps, or receive an error in doing so, please contact our support team at [email protected] or 1300 638 734 for further assistance.