How do I update my WordPress database connection string?

If your WordPress site displays the error ‘Error Connecting to the Database’, you’ll need to update the connection strings. This can be done by following the steps outlined in this article.

Please note: this service is only available with Managed WordPress plans purchased after May 2021.

Step 1 of 6

Start by connecting to your hosting using an FTP client such as FileZilla. For details on how to do this, please read our Support article: How do I upload files using SFTP?

 

Step 2 of 6

From there, find your wp-config.php file, right-click it and select Edit from the list of options.

If your system asks which software you wish to use to open this file, choose Notepad.

Edit your Config file

 

Step 3 of 6

Locate the section that looks like this:

/** The name of the database for WordPress */
define(‘DB_NAME’, ‘yourdatabasename‘);

/** MySQL database username */
define(‘DB_USER’, ‘yourusername‘);

/** MySQL database password */
define(‘DB_PASSWORD’, ‘yourpassword‘);

/** MySQL hostname */
define(‘DB_HOST’, ‘yourhostname‘);
$table_prefix  = ‘yourtableprefix‘;

 

Step 4 of 6

Confirm the information in this file matches your details:

  1. yourdatabasename should match your MySQL Database Name
  2. yourusername should match your MySQL Username
  3. yourpassword should match your MySQL password
  4. yourhostname should match your MySQL Host Name

yourtableprefix should match your Table Prefix

Step 5 of 6

If any of the information within your wp-config.php file doesn’t match your database details, then update the file with the correct information.

 

Step 6 of 6

Save the updated file to confirm your changes. Be sure to check your website to make sure it’s back online.