BuycPanel Blog

BuycPanel Blog

Latest news and updates

How do you Restore a cPanel User’s Database?

Posted by Allura on 16 04 2019.

The General Overview
In case a cPanel user loses access to their databases, they can restore their grants to the database by virtue of the restore grants script. To utilize the restore-grants scripts in order to restore the user’s accesses to databases, one of these following commands has to be run:

 	/usr/local/cpanel/bin/restoregrants–cpuser=$cpuser –db=$type –dbuser=$dbuser
 	/usr/local/cpanel/bin/restoregrants–cpuser=$cpuser –db=$type  –all

$cpuser here, represents the cPanel username which has lost its access to their databases. $type represents the type of database such as mysql for My SQL and pg for Postgre SQL. Lastly, the $dbuser represents the database user whose privileges the cPanel wishes to restore – in case you are using the – – dbuser flag, $dbuser is representing the database user whereas if you are using the – – all flag, the script restores grants for every database user who is associated with the cPanel account.

Updating the cPanel User’s Password
In very many circumstances, the restore grants…

The General Overview

In case a cPanel user loses access to their databases, they can restore their grants to the database by virtue of the restore grants script. To utilize the restore-grants scripts in order to restore the user’s accesses to databases, one of these following commands has to be run:

  1. /usr/local/cpanel/bin/restoregrants–cpuser=$cpuser –db=$type –dbuser=$dbuser
  2. /usr/local/cpanel/bin/restoregrants–cpuser=$cpuser –db=$type  –all

$cpuser here, represents the cPanel username which has lost its access to their databases. $type represents the type of database such as mysql for My SQL and pg for Postgre SQL. Lastly, the $dbuser represents the database user whose privileges the cPanel wishes to restore – in case you are using the – – dbuser flag, $dbuser is representing the database user whereas if you are using the – – all flag, the script restores grants for every database user who is associated with the cPanel account.

Updating the cPanel User’s Password

In very many circumstances, the restore grants script might fail to restore the accesses to databases. In such a situation, either the cPanel user or the WHM user who owns the account can reset the password of the cPanel account in order to restore the grants.

A cPanel user can restore grants by following the given steps:

  • Navigate to the cPanel’s Passwords and Security Interface (cPanel >> Home >> Preferences >> Password and Security).
  • Select ‘allow My SQL Password change’.
  • In the Old Password text box, you need to enter your old password.
  • In the New Password and New Password (again) text boxes, enter the new password.
  • In this last step, click on ‘Change your password now’.

The server administrator or the reseller can also restore grants by following the given steps:

  • You need to navigate to WHM’s List Accounts interface (WHM >> Home >> Account Information >> List Accounts).
  • Next to the appropriate account, you need to click on the ‘+ link’.
  • Then, you select Sync My SQL password’ with your account password.
  • In the ‘Change Password’ text box, you need to enter a new password.
  • Click