Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: How to Restore Database Grants in WHM  (Read 3762 times)

0 Members and 1 Guest are viewing this topic.

vichithrakumart

  • Guest
How to Restore Database Grants in WHM
« 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.