In WordPress, the database credentials, including the database password, are typically stored in the wp-config.php file. This file is located in the root directory of your WordPress installation. Here’s how you can change the database password in WordPress:
- Access the 
wp-config.phpfile:- Use an FTP client or access your hosting control panel to navigate to the root directory of your WordPress installation.
 - Look for a file named 
wp-config.phpand download it to your local machine. 
 - Open 
wp-config.phpin a text editor:- You can use a simple text editor like Notepad (on Windows) or TextEdit (on Mac).
 - Alternatively, you can use a code editor like Visual Studio Code or Sublime Text for a better experience.
 
 - Locate the database connection settings:
- In 
wp-config.php, you’ll find a section that looks like the following: 
 - In 
 
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'your_database_name');
    /** MySQL database username */
    define('DB_USER', 'your_database_user');
    /** MySQL database password */
    define('DB_PASSWORD', 'your_database_password');
    /** MySQL hostname */
     define('DB_HOST', 'localhost');
- Update the 
DB_PASSWORDfield:- Change the value inside the single quotes for 
DB_PASSWORDto your new database password. 
 - Change the value inside the single quotes for 
 
       define('DB_PASSWORD', 'your_new_database_password');
- Save and upload the 
wp-config.phpfile:- Save the changes you made to the 
wp-config.phpfile. - If you downloaded the file, upload it back to the root directory of your WordPress installation, replacing the existing file.
 
 - Save the changes you made to the 
 
After making these changes, your WordPress site should be able to connect to the database using the new password. Make sure to keep a backup of the original wp-config.php file before making any changes, just in case you need to revert to the previous configuration.

I’m Abhishek, a DevOps, SRE, DevSecOps, and Cloud expert with a passion for sharing knowledge and real-world experiences. I’ve had the opportunity to work with Cotocus and continue to contribute to multiple platforms where I share insights across different domains:
- 
DevOps School – Tech blogs and tutorials
 - 
Holiday Landmark – Travel stories and guides
 - 
Stocks Mantra – Stock market strategies and tips
 - 
My Medic Plus – Health and fitness guidance
 - 
TrueReviewNow – Honest product reviews
 - 
Wizbrand – SEO and digital tools for businesses
 
I’m also exploring the fascinating world of Quantum Computing.
[…] How to change database credential in wordpress […]