How to Change a cPanel Database User Password

Change a database user's password if it may have been exposed, if a developer who knew it no longer works with you, or as routine maintenance.

Steps

  1. In cPanel, open MySQL® Databases.
  2. Find the user under Current Users.
  3. Click Change Password next to it.
  4. Use the Password Generator and copy the new password somewhere safe.
  5. Click Change Password to confirm.

Update your application immediately

The moment you change the password, any application still using the old one stops working. Update the configuration file straight away.

For WordPress, edit wp-config.php:

define('DB_PASSWORD', 'your-new-password');

Other applications keep the same details in their own configuration — commonly config.php, .env or a settings file in the application root.

Plan for a moment of downtime

Between changing the password and updating the configuration, your site will show a database connection error. Have the configuration file open and ready to edit before you make the change, and do it at a quiet time.

If the site does not come back

  • Check for a typo or a trailing space in the pasted password.
  • Confirm you edited the configuration file the live site actually uses.
  • Clear any application or server-side cache.
Was this article helpful?