+254725682556 +254725052660 info@ziprof.co.ke
Client Area

Databases

How to Change or Reset a MySQL Database User's Password

If you've forgotten a MySQL database user's password, or you want to rotate it for security reasons, you can reset it directly from your hosting control panel. The process takes a minute, but you also need to update any file on your website that stores the old password, otherwise your site will stop connecting to the database.

Before you start

Changing a database user's password does not automatically update the sites or scripts that use it. Most CMS platforms and custom applications store the database password in a single configuration file, so plan to edit that file right after you reset the password.

If the database is connected to a live WordPress site, changing the password without also updating wp-config.php will immediately break the site with a database connection error.

How to reset the password

In cPanel

  1. Log in to cPanel and open MySQL Databases under the Databases section.
  2. Scroll down to the Current Users list and find the username you want to update.
  3. Click Change Password next to that user.
  4. Enter a new strong password, or click Password Generator to create one, then confirm it.
  5. Click Change Password to save the new password.

In DirectAdmin

  1. Log in to DirectAdmin and open MySQL Management.
  2. Click on the database that the user belongs to.
  3. Find the user in the list and click Modify next to their name.
  4. Enter and confirm the new password.
  5. Click Save or Modify User to apply the change.

Update your website's configuration

Once the password is changed, update it wherever your site stores its database credentials:

  • WordPress: edit wp-config.php and update the DB_PASSWORD value.
  • Other custom PHP applications: check the database connection file, often named config.php, database.php, or a .env file.
  • Any desktop tool or scheduled script that connects directly to the database, such as a reporting tool or an import job.

You can edit these files using the File Manager in cPanel or DirectAdmin, or by connecting via FTP.

Use a different, strong password from any other account on your hosting, and avoid reusing a password you've used elsewhere. A password manager or the panel's built in generator is the safest way to create one.

For help creating a new database and user from scratch, see How to Create a MySQL Database and Database User.