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

Don't have a website yet? 
With WordPress, you can easily and quickly build the website of your dreams.

Add to cart


Step 1 - Open File Manager

  1. Log into the one.com Control Panel.
  2. Click File Manager under Files & Security.
Screenshot of File Manager in one.com Control Panel.

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.

Screenshot of the wp-config.php file in File Manager.


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');

Screenshot of the wp-config.php file in File Manager.


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.

Screenshot of the wp-config.php file in File Manager.


Related articles:

Was this article helpful?

Can’t find what you are looking for?

Start a chat

It's the quickest way to get in touch, every day of the year.

Give us a call

Available on weekdays from 10am to 2pm (UTC).