Skip to content

What is DB_Password and how to change it?

  • by
  • 3 min read

Any developer who works with WordPress knows that there is a lot more to the platform than just a flashy dashboard that anyone can use whether they have any coding experience or not. There are a lot of things going on in the background that you need to configure properly. 

WordPress needs a database to store all the account credentials and other important information it needs to function properly. That said, such critical information needs to be protected. 

In this article, we’re talking about DB_Pasword in the WordPress config files, its importance and how you can change this password. 

Also read: What is WordPress? Everything you need to know

DB_Password explained

The DB_Password field resides in your wp-config.php file that controls the entire WordPress configuration as well as the connection to the main database. The file is located in the root directory of the WordPress installation and can be edited to control certain factors about the deployment. 

While you wouldn’t usually need to change anything about your installation or fiddle with configuration files, if you’re installing WordPress manually, you need to add your database credentials manually in this file. 

How to install WordPress on XAMPP? 7 easy steps to do so
Manual WordPress installations often require some setting up to kick things off.

There are certain fields that you need to set for the file to work correctly, which are none other than your database credentials as follows:

  • DB_NAME: The name of the default database. 
  • DB_USER: Database alias username used to access data. 
  • DB_PASSWORD: The accompanying password for the username.
  • DB_HOST: The address of the database server. 

As you can guess, without the password you can’t quite use the database, leaving your installation useless. 

Admin_passwd vs DB_Password

There’s a huge difference between your WordPress admin password and your database password. The admin password is used to control access to the WordPress backend, securing it from unauthorised access. Database password on the other hand is the password required to access the database where WordPress stores all user credentials and other sensitive information. 

Changing the Database password

If you’re migrating databases or changing something else, you need to edit the wp-config.php file to reflect the changes. Here’s how. 

Step 1: Log into your Website server and access the WordPress installation directory. You’ll see the wp-config.php file here (usually stored inside a folder in the public_html folder). Double-click the file to edit. 

Keep in mind that your website server and file manager are different from your WordPress backend. These servers are usually accessible by the domain’s CPanel dashboard. 

What is DB_Password and how to change it?

Step 2: In the opened file you can change the parameters as required, including DB_PASSWORD. 

What is DB_Password and how to change it?

Also read: Top 7 notification plugins for WordPress

Yadullah Abidi

Yadullah Abidi

Yadullah is a Computer Science graduate who writes/edits/shoots/codes all things cybersecurity, gaming, and tech hardware. When he's not, he streams himself racing virtual cars. He's been writing and reporting on tech and cybersecurity with websites like Candid.Technology and MakeUseOf since 2018. You can contact him here: