Changing the Joomla database password
If you update your database user’s password in cPanel or on your server, you must also update Joomla’s configuration so the site can continue connecting to the database. On ruachost.com, this is done through the Joomla administrator interface or by editing the configuration file.
Why Change the Database Password?
Section titled “Why Change the Database Password?”- After resetting the database user password in cPanel or phpMyAdmin.
- To improve security by rotating credentials.
- When migrating Joomla to a new hosting account or server.
- To resolve database connection errors.
Method 1: Using Joomla Administrator
Section titled “Method 1: Using Joomla Administrator”- Log in to your Joomla site with an administrator account.
- On the top menu bar, click System → Global Configuration.
- Select the Server tab.
- Under Database Settings, locate the Database Password field.
- Enter the new password.
- Click Save.
Method 2: Editing configuration.php
Section titled “Method 2: Editing configuration.php”If you cannot access the Joomla admin panel:
-
Log in to your hosting account via cPanel File Manager or SSH.
-
Navigate to your Joomla installation directory.
-
Open the
configuration.phpfile in a text editor. -
Locate the following line:
public $password = 'old_password'; -
Replace
'old_password'with your new database password:public $password = 'new_password'; -
Save the file and exit.
Important Notes
Section titled “Important Notes”- The new password must match the one set for the database user in cPanel or phpMyAdmin.
- Always back up your site before making configuration changes.
- If you mistype the password, Joomla will display a database connection error.
- Clear Joomla cache after updating the password.