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

Change the MySQL Root Password in WHM

This guide shows you how to set a new MySQL root password using WHM. It needs root access to your server.

Databases2 min read6 steps4 screenshots
Note: This guide needs root access. VPS and dedicated server customers have it. Shared hosting customers do not.

What is the MySQL root password?

MySQL is a database system. A database is a store for your websites' information.

The MySQL root user is the boss account for all databases on the server. Its password protects every website's data. You should change it if you think someone else knows it, or if you set a weak one.

WHM stands for WebHost Manager. It is the admin panel for people who run a cPanel server. Regular cPanel accounts are managed inside it.

Before you start

Warning: changing this password can stop things that use the old one. Take a backup of your databases first. Tell anyone who uses the root login about the change.

Steps

  1. Log in to WHM as root. The address is usually your server address followed by :2087. Your welcome email has the details.
  2. In the search box at the top left, type MySQL Root Password.
    Screenshot: In the search box at the top left, type MySQL Root Password .
  3. Click MySQL Root Password in the results.
    Screenshot: Click MySQL Root Password in the results.
  4. Type your new password in the New Password box.
  5. Click Change Password.
  6. Wait for the green success message.

WHM updates the saved password file for you. This is the file that lets cPanel talk to MySQL.

Make a strong password

  • Use at least 12 characters.
  • Mix capital and small letters, numbers and symbols.
    Screenshot: Mix capital and small letters, numbers and symbols.
  • Do not use names, birthdays or common words.

WHM has a Password Generator button. It makes a random password for you. Save it in a password manager.

Screenshot: WHM has a Password Generator button. It makes a random password for you. Save it in a pass

Check that it works

Connect with SSH and type the command below. SSH lets you type commands on the server.

mysql -u root -p

This logs in to MySQL as root and asks for the password. If you reach the mysql> prompt, the new password works. Type exit to leave.

Tip: If WHM gives an error, you may have lost the old password. The guide on the MySQL root password on a dedicated server shows how to reset it, or open a support ticket.

Quick recap

  • The MySQL root password protects all databases on your server.
  • In WHM, search for MySQL Root Password.
  • Enter a strong new password and click Change Password.
  • Back up first and test the new login.