How to change your WordPress database password

This guide will explain how to change your WordPress database password for customers using web hosting and WordPress hosting

If you’ve installed WordPress or you are using our WordPress hosting, simply follow the steps listed below. 

Let’s get started… 

Changing the password 

  1. Login to your LCN account and move your Control Panel
  1. Click the domain you wish to perform a change to. 
  1. Click Hosting Settings followed by MySQL 
  1. You will now see your MySQL Databases for that domain. Click the Database name for the one you wish to update. 
  1. Next click on the Username being used to access the Database by your WordPress site. 
  1. Enter a New Password in the first box. 

Please Note: To make sure your chosen password is secure you will need to make sure that it is at least 8 characters long, it must also include at least 3 of the following: Lower case letter, upper case letter, number, special character. For a guide on making a secure password click here

  1. Followed by Confirm Password in the second box. 
  1. You can adjust the other settings if needed, other wise scroll down to the bottom and click Save. 

Success! You’ve changed your WordPress database password. Making this change will cause your website to display an Error establishing a database connection message until you’ve completed the steps listed in the second half of this guide. 

Updating the WordPress configuration file 

Now you’ll need to update the password in the WordPress configuration file. 

To do this you will need to access your hosting using FTP which you can learn more about here. Alternatively, you can use File Manager which you can find out more about here

The below instructions will cover how to make this change via FTP.  

  1. Using your FTP client, navigate to the Web folder 
  1. Right-click the wp-config.php file and select View/Edit 
  1. Select Use default editor for text files and click OK 
  1. Once the file has opened, find the section below: 
define(‘DB_PASSWORD’, ‘oldPassword123!’); 

  1. Replace the password inside the quotation marks with the new database password you chose earlier 
  1. Click the X in the top right of your text editor to close it 
  1. You’ll be prompted to save the file you’ve just edited, click Save 
  1. A box will appear notifying you that A file previously opened has been changed. Click Yes

That’s it! You’ve changed your WordPress database password and updated your WordPress configuration file. 

Was this article helpful?

Check out some of our related guides

Need a hand? Search over a hundred step-by-step support guides