Question
How do I restore MySQL grants?
Answer
cPanel stores grant information in the /var/cpanel/databases/grants_user.yaml files, where the user represents the account username. The restoregrants script can restore lost grants from these files.
- Log in to SSH as the
rootuser via SSH or Terminal in WHM. -
Run the following command:
# /usr/local/cpanel/bin/restoregrants --cpuser=$username --db=mysql --dbuser=$dbuser
Note:
$usernameand$dbusermust be replaced with the cPanel account username and the database username, respectively.
Additional Resources
How to Restore Database Grants
How to use a while loop in BASH to iterate over all cPanel users on a server
Comments
0 comments
Article is closed for comments.