# Changing the Joomla database password

> Update Joomla with your new database password after changing it in cPanel, using the admin panel or the configuration.php file.

Source: https://helpcenter.ruachost.com/apps/joomla/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?

- 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

1. Log in to your Joomla site with an **administrator account**.
2. On the top menu bar, click **System → Global Configuration**.
3. Select the **Server** tab.
4. Under **Database Settings**, locate the **Database Password** field.
5. Enter the new password.
6. Click **Save**.

## Method 2: Editing configuration.php

If you cannot access the Joomla admin panel:

1. Log in to your hosting account via **cPanel File Manager** or **SSH**.
2. Navigate to your Joomla installation directory.
3. Open the `configuration.php` file in a text editor.
4. Locate the following line:

   ```
   public $password = 'old_password';
   ```
5. Replace `'old_password'` with your new database password:

   ```
   public $password = 'new_password';
   ```
6. Save the file and exit.

## 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.
