Update WordPress database connection details
Sometimes, you need to update the database connection details in WordPress. For example, when you've changed the database password, or if you get the following error message:
Error establishing a database connection
- Step 1 - Open File Manager
- Step 2 - Open wp-config.php
- Step 3 - Locate the login details
- Step 4 - Update details
Don't have a website yet?
With WordPress, you can easily and quickly build the website of your dreams.
Step 1 - Open File Manager
- Log into the one.com Control Panel.
- Click File Manager under Files & Security.
Step 2 - Open wp-config.php
The wp-config.php file is located in the directory where you installed WordPress.
Click on the wp-config file to open it in the editor.
Step 3 - Locate the login details
Usually, you can find the login details around line 20 in the wp-config file.
In this example the current details are:
define('DB_NAME', 'one_example_support');
define('DB_USER', 'one_example_support');
define('DB_PASSWORD', '********');
define('DB_HOST', 'one-example.support.mysql');Step 4 - Update details
In the following example, you need to replace update_here with your own updated details.
You can find the current connection details in the one.com Control Panel under PHP and database settings.
define('DB_NAME', 'update_here');
define('DB_USER', 'update_here');
define('DB_PASSWORD', 'update_here');
define('DB_HOST', 'update_here');Click Save in the upper left corner on your screen.
Related articles: