Update WordPress database connection details

Step 1 - Open File Manager
Step 2 - Open wp-config.php
Step 3 - Locate the login details
Step 4 - Update details

Sometimes you need to update the database connection details in WordPress. For example after you have changed the MySQL password or if you get the following error message:

Error establishing a database connection

Step 1 - Open File Manager

Login to your One.com Control Panel and click File Manager.

Open File Manager

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.

Open wp-config.php

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.service.one.com');

Find details in wp-config.php

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 & MariaDB.

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.

Edit details in wp-config,php

Related articles:

Change your WordPress theme from the database
Disable WordPress plugins in phpMyAdmin