CAll Us: +91 88 00 563434   Login

How to Reset MySQL Root Password and Restore Database Grants in cPanel Server?

You are here:
< All Topics

Reset MySQL root Password

We will reset mysql root password through command line in Linux server. Additionally, we are able to use this methodology in cPanel server, however there may be some downside WHM is not going to know the brand new root mysql password and database options will fail with entry denied from mysql. So in cPanel server, it would be best to reset the mysql root password by means of WHM.

Please refer the next hyperlink to learn how to reset MySQL root password in Linux server through command line. https://www.webhostingpeople.web/ideas/kb/how-to-recover-the-mysql-root-password/

On this tutorial will make it easier to to know learn how to reset MySQL root password through WHM.

1) Login to WHM as a root consumer.

2) From there choose “SQL Companies”.

Reset MySQL password

3) Then click on on the button “MySQL Root Password”.

Reset MySQL password

4) Now enter the brand new password and click on on “Change Password” button.

Reset MySQL password

Restore Database Grants.

The cPanel offers “restoregrants” utility to revive the consumer’s database entry.

1) Login to the server as a root consumer through SSH.

2) Run both of the next instructions from command line.

/usr/native/cpanel/bin/restoregrants –cpuser=$cpuser –db=mysql, pg –dbuser=$dbuser

/usr/native/cpanel/bin/restoregrants –cpuser=$cpuser –db=mysql, pg  –all

$cpuser is the cPanel username that has misplaced entry to databases.

mysql, pg is the kind of database: mysql for MySQL or pg for PostgreSQL

$dbuser >> The database consumer whose privileges you that want to restore. Should you use the –dbuser flag, the $dbuser variable will include the database consumer’s identify. Should you use the –all flag, the script will restore grants for the entire database customers that the cPanel account owns.

Should you want any additional assist please do attain our help division.

Knowledge Base