Knowledge Base
WordPress: How to Update Database Connection Strings
Your WordPress website must be connected to a database for it to function and be accessible online. This article will guide you through the process of updating the connection strings of your WordPress website if you need to connect it to a different database.
Step 1: Get Your New Database Information
- Log in to your Account Manager.
- Click Hosting in the left-hand menu.
- Search for the hosting plan where your database is, and then click its Manage button.
- Navigate to your new database.
For accounts created after April 2024, please follow these steps.
- Click MySQL Management in the left-hand menu.
- Locate the database you need to manage, then click its Manage link on the right.
- Take note of the database name and username. You may also need to change the password by clicking the Change Password option.
For accounts created before April 2024, please follow these steps.- Click Database Manager under Configurations.
- Look for your new database and click the database name.
- Take note of the database name and username. You may also need to change its password if you no longer remember it.
Step 2: Update Your wp-config.php File
- Within your Account Manager, navigate to the Hosting tab.
- Search for the hosting plan where your WordPress is being hosted, and then click its Manage button.
-
For accounts created after April 2024, please follow these steps.
- Click File Manager on the left-hand menu.
- Click your site's folder (directory). For this example, we'll use the public_html folder.
For accounts created before April 2024, please follow these steps.- Take note of your FTP information under the Hosting Information section on the right.
- Launch your FTP client and use your FTP info to connect to your website's File Manager. Visit the FTP: How to Connect Using an FTP Client article for instructions.
- Navigate to your site's folder (directory). For this example, we'll use the public_html folder.
- Within the public_html (your site's folder), locate the wp-config.php file, click on the three-dot menu on the right, and select Edit.
- Locate the following lines of code:
// ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', 'database_name'); /** MySQL database username */ define('DB_USER', 'database_username'); /** MySQL database password */ define('DB_PASSWORD', 'DatabasePassword'); /** MySQL hostname */ define('DB_HOST', 'localhost');
- Change the values for the database name, username, and password.
- Click the Save button to save your changes.
- Relaunch and check your website in a browser.