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:
$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.
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:
The server administrator or the reseller can also restore grants by following the given steps: