Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Change a Database User Password in DirectAdmin

This guide shows how to set a new password for a database user in DirectAdmin. It also shows what to update afterwards so your site keeps working.

DirectAdmin2 min read13 steps5 screenshots

What is a database user?

A database stores the information of your website, such as posts, orders and settings. A database user is a login that is allowed to open that database. Your site uses this login in the background. You can think of it as a key that only your website holds.

Very important warning

If you change the database password, your website will lose its connection until you update its config file. A config file is a settings file inside your site folder. Do both parts of this guide together. Take a backup first.

Part 1: Change the password in DirectAdmin

  1. Log in to DirectAdmin.
  2. Open MySQL Management. It is in Account Manager or Extra Features.
    Screenshot: Open MySQL Management . It is in Account Manager or Extra Features .
  3. Click the name of the database you use.
  4. Find the list of database users.
    Screenshot: Find the list of database users.
  5. Click Change Password next to the user.
    Screenshot: Click Change Password next to the user.
  6. Type a new password. Type it again to confirm.
  7. Click Save.

Use a strong password. Avoid characters such as quotes, spaces and the "#" symbol, because they can cause trouble in config files.

Part 2: Update your website

Each app stores the database password in its own file. Here are common ones.

AppFileSetting
WordPresswp-config.phpDB_PASSWORD
Joomlaconfiguration.php$password
Other appsSee the app's own guide
  1. Open File Manager in DirectAdmin.
  2. Go to your website folder. This is often public_html.
  3. Open the config file for your app.
  4. Replace the old password with the new one. Keep the quotes around it.
  5. Save the file.
  6. Open your website. It should load again.

If you see "Error establishing a database connection"

The password in the config file probably does not match. Check for extra spaces or a typo. Make sure the database name and user are right too.

Tip: Copy and paste the password instead of typing it. This avoids typing errors.

Quick recap

  • A database user is the login your site uses to reach its data.
  • Change the password in MySQL Management.
    Screenshot: Change the password in MySQL Management .
  • Then update the same password in your site's config file.
  • Back up first, and test the site afterwards.
  • Use simple symbols in the password to avoid errors.
    Screenshot: Use simple symbols in the password to avoid errors.