> ## Documentation Index
> Fetch the complete documentation index at: https://support.webcentral.au/llms.txt
> Use this file to discover all available pages before exploring further.

# WordPress : Error establishing database connection

If you've uploaded WordPress onto your hosting account and its getting the below error.

![Error establishing database connection](https://files.readme.io/8ae5394-error_db.PNG)

It might be that your Database credentials are incorrect in the **wp-config.php** file. To fix this problem, follow the instructions below:

* [FTP connect](https://support.netregistry.com.au/articles/nr/Upload-and-download-files-via-FTP) to your hosting account using your account [FTP details](https://support.webcentral.au/s/article/FTP-details), Or you can login to cPanel and access the [File Manager](/websites-hosting/general-information/how-to-upload-files-using-file-manager).
* Open the **wp-config.php** file (located in the webroot folder, in cPanel it would be the **public\_html** folder)
* Make sure your database name, username, password and hostname are correct ([you can find instructions below depending on your hosting](/websites-hosting/cpanel/mysql-database-connection-string))
* Find the database string below in the **wp-config.php** file and replace the relevant credentials with the correct information.

```php theme={null}
// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'your-databas-ename' );

/** Database username */
define( 'DB_USER', 'your-datbase-username' );

/** Database password */
define( 'DB_PASSWORD', 'your-database-password' );

/** Database hostname */
define( 'DB_HOST', 'localhost' );

/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );

/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );
```

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

## Cloud Hosting : Database credentials

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

1. [Log into the Console](https://support.webcentral.au/s/article/How-to-log-in-to-your-Webcentral-account)
2. Click the domain you want to [manage](https://support.netregistry.com.au/articles/nr/Manage-your-domain)
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 : Database credentials

1. [Log into the Console](https://support.webcentral.au/s/article/How-to-log-in-to-your-Webcentral-account)
2. Click the domain you want to [manage](https://support.netregistry.com.au/articles/nr/Manage-your-domain)
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 submit a support request through your console or call us on 1300 638 734 for further assistance.
