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.
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?
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.
Locate the section that looks like this:
/** The name of the database for WordPress */
/** MySQL database username */
/** MySQL database password */
/** MySQL hostname */
$table_prefix = ‘yourtableprefix‘;
Confirm the information in this file matches your details:
- yourdatabasename should match your MySQL Database Name
- yourusername should match your MySQL Username
- yourpassword should match your MySQL password
- yourhostname should match your MySQL Host Name
yourtableprefix should match your Table Prefix
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.
Save the updated file to confirm your changes. Be sure to check your website to make sure it’s back online.