To reset the MySQL root password in WebHost Manager (WHM), you can follow these steps:
- Log in to WHM.
- Go to SQL Services > MySQL Root Password.
- Enter a new password for the MySQL root user in the New Password and New Password (again) fields.
- Click the Change Password button.
WHM will restart the MySQL server and apply the new password.
Note: It is important to choose a strong password for the MySQL root user. A strong password is at least 12 characters long and includes a mix of upper and lowercase letters, numbers, and symbols.
Alternate method:
If you are unable to log in to WHM, you can reset the MySQL root password from the command line. To do this, follow these steps:
- Log in to your server as the root user.
- Stop the MySQL server:
service mysql stop
- Start the MySQL server in safe mode:
mysqld_safe --skip-grant-tables --skip-networking
- Connect to the MySQL server as the root user:
mysql -u root
- Reset the MySQL root password:
UPDATE mysql.user SET password = PASSWORD('new_password') WHERE user = 'root';
- Flush the privileges table:
FLUSH PRIVILEGES;
- Stop the MySQL server:
quit
- Start the MySQL server normally:
service mysql start
You should now be able to log in to WHM using the new MySQL root password.
Note: If you are using a managed hosting provider, you may need to contact them for assistance resetting the MySQL root password.