How To Change Your WordPress Database Password

In this tutorial, we show you how to change your WordPress database password.

WordPress Security TutorialsThis tutorial is part of our tutorial series on WordPress Security. In this tutorial, you will learn how to change your WordPress database password.

***

How To Change Your WordPress Database Password

If you need to change your WordPress database password, follow the steps below:

Log into your cPanel account …

Log into cPanel

(Log into cPanel)

Go to cPanel > Databases > MySQL Databases

cPanel - MySQL Databases

(cPanel – MySQL Databases)

Scroll down to the ‘Current Users’ section, select the user account  and click on ‘Change Password’ …

MySQL Database: Users - Change Password

(MySQL Database: Users – Change Password)

Change the password. Make sure you choose a very strong new password and copy this password to a plain text file …

MySQL Databases - Set New Password

(MySQL Databases – Set New Password)

After changing the current user password, you also need to change the password inside your wp-config.php file. Otherwise, you will experience an “error connecting to the database” error.

If you have been following our WordPress maintenance tutorials, you should have a backup copy of your wp-config.php file stored in your hard drive or remote storage location.

You can edit the wp-config.php file by going to cPanel > Files > File Manager

cPanel:Files - File Manager

(cPanel:Files – File Manager)

Or edit a copy of the file and then replace the wp-config.php file on your server using FTP …

wp-config.php

(wp-config.php)

Replace the ‘DB_Password’ field in your wp-config.php file with the same password used earlier. Note: Make sure to replace only the string inside the single quote marks and check that there are no spaces or misspelled characters to avoid errors. Save the file to update …

Change password in wp-config.php file

(Change password in wp-config.php file)

Remember to test your site to make sure that everything is working correctly.

Congratulations! Now you know how to change your WordPress database password.

***

"I am beyond impressed with what you have put together. I can tell that you put a ton of hard work into building what you have. You have the absolute best content on WordPress I have ever seen!" - Robert T. Jillie

***

Recommended Video Courses For WordPress Users

Using Password ManagersUsing Password Managers

Password Managers provide an easy and secure way to keep track of all your passwords. This video course shows you how to use two FREE powerful password management tools.

More info: Using Password Managers

Recommended Video Courses For WordPress Users

How To Use FTPHow To Use FTP

This video course shows you how to use FTP (File Transfer Protocol) to transfer and upload files between your hard drive and your server using a free FTP program called Filezilla.

More info: How To Use FTP

Recommended Video Courses For WordPress Users

How To Set Up WordPress On LocalhostHow To Set Up WordPress On Localhost

Learn how to install, set up, and locally host a fully functioning WordPress site on your computer.

More info: How To Set Up WordPress On Localhost

Recommended Video Courses For WordPress Users

How To Use Amazon S3How To Use Amazon S3

Learn how to set up and use Amazon S3 to upload, store, manage, and protect your site’s images, large media files, downloadable files, stream videos and more.

More info: How To Use Amazon S3

Recommended Video Courses For WordPress Users

How To Use cPanelHow To Use cPanel

cPanel is a powerful and simple-to-use web hosting management software application that gives website owners the ability to quickly and easily manage their servers and websites using a simple and intuitive dashboard.

This video course will teach you how to use the main features of cPanel to manage your web hosting.

More info: How To Use cPanel

Recommended Video Courses For WordPress Users

WordPress SecurityWordPress Security

Learn how to keep your WordPress site or blog secure and protected from malware, hackers and brute-force attacks.

More info: WordPress Security

Recommended Video Courses For WordPress Users

How To Back Up & Restore WordPress SitesHow To Back Up & Restore WordPress Sites

Learn how to safely and automatically backup your WordPress files and database and how to easily restore your WordPress site if something were to happen.

More info: How To Back Up & Restore WordPress Sites

Author: Martin Aranovitch

Martin Aranovitch is the founder of WPCompendium.org and the author of The Small Business Digital Manager. WPCompendium.org provides hundreds of FREE tutorials that show you how to use WordPress to grow your business online with no coding skills required! Get our FREE "101+ WordPress Tips, Tricks & Hacks For Non-Techies" e-course with loads of useful WordPress tips!

Originally published as How To Change Your WordPress Database Password.