Admin-Ahead Community

Linux => Control Panels => cPanel => Topic started by: vichithrakumart on April 07, 2018, 03:59:48 pm

Title: How to Restore Database Grants in WHM
Post by: vichithrakumart on April 07, 2018, 03:59:48 pm
If a database user loses access to databases, you can restore the user's grants to the database with the restoregrants utility.

Execute either of the following commands from the command line:

Code: [Select]
/usr/local/cpanel/bin/restoregrants --cpuser=$cpuser --db={mysql, pg} --dbuser=$dbuser
$cpuser = The cPanel username that has lost access to databases.
{mysql, pg} = The type of database: mysql for MySQL® or pg for PostgreSQL®.
$dbuser = The database user whose privileges you that wish to restore. If you use the --dbuser fiag, the $dbuser variable will consist of the database user's name. If you use the --all flag, the script will restore grants for all of the database users that the cPanel account owns.