How to Change the Database Password in Joomla?

In some situations, you may find yourself forced to change the database password of your Joomla website. Such situations include:

  • Your website just got hacked.
  • You gave all the website credentials (particularly the username and the password of the database) to a developer that you no longer trust.
  • You have a good habit of changing all your passwords regularly.

So how do you change the password for your Joomla database?

This is a two step process, and we are assuming you are hosting with a company that offers cpanel (if you’re not, then maybe you should consider switching to us!).

Step 1: Change your database password in Cpanel

Here’s how yo do it:

  1. Login to Cpanel (Typically your cpanel address would be http://www.yourwebsitaddress:2028).
  2. Click on “MySQL Databases” near the bottom of the page (located under a section called “Databases”).
  3. Scroll down to the bottom of the page, to the section called “Current Users.
  4. Click on the Joomla database user.
  5. Enter the old password and the new password.
  6. The password is now changed, that’s the good news. The bad news is that your website has stopped working! You need to execute Step 2 immediately to get it back up!

Step 2: Change your database password in Joomla

Here’s how yo do it:

  1. Connect to your website through FTP.
  2. Download the file “configuration.php”.
  3. Open the file “configuration.php” in a text editor, such as Notepad.
  4. Change the “$password” value to a new value.
  5. Upload the file, and you’re done!

Now is there a way to change your database password while having no downtime on your Joomla website? Yes there is! All you need to do is do the following:

  1. Create a new database user in Cpanel.
  2. Give the user access to your Joomla database.
  3. Update your configuration.php file to point to the new user (you have to change both the “$user” and the “$password” entries, where “$user” becomes the username of the new user, and “$password” becomes the password of the new user).
  4. Upload your configuration.php (now your website is connecting by using your new user).
  5. Now go your cpanel again, and change the password of the user as described in “Step 1” above.
  6. Now update your configuration.php to reflect the credentials of the old user with the new password that you just set.
  7. Upload your configuration.php file, and now you’re done with 0 seconds of downtime!

If you feel that the process above is a bit over your head, then go ahead, contact us. We will only charge you for one hour for doing the above (check our fees to see how much would that cost you)!

3 Responses to “How to Change the Database Password in Joomla?”
  1. Pingback by 10 Reasons Why Your Joomla Website Got Hacked | itoctopus — June 20, 2011 @ 5:41 pm

    […] to, then change all your passwords once the developer is done working. We have already explained how to change your Joomla database password with no downtime. Note: At itoctopus, we immediately destroy the customer’s website credentials once […]

  2. Comment by Teo — February 11, 2012 @ 5:44 pm

    This help did not work for me. My web designer used joomla 1.5; and a I tried to change my host password, and the joomla page does not work. What can I do?

  3. Comment by Fadi — February 11, 2012 @ 5:52 pm

    Hi Teo,

    Odd, this should work… Please contact us if you can’t do the above.

Leave a comment