First things first, make sure to resolve the database version discrepancy, if one exists. Back up your data, then upgrade or downgrade MySQL to the version that your server should be running. Note that you should typically avoid downgrading MySQL to a previous version in order to prevent corrupting data. After you upgrade, run the command “mysql_upgrade” to fix the tables if the procedure in the referenced article doesn’t already do this for you.
To restore privileges:
Run the following command to dump the privilege table into a MySQL syntax that can be easily imported:
/scripts/grabmysqlprivs > /root/privileges.sql*If you only need a certain user’s privileges, simply use grep to pull out that data:
/scripts/grabmysqlprivs | grep $user > /root/privileges.sqlOn the server you need to restore to, simply import then SQL file:
mysql < /root/privileges.sqlThis should be sufficient, however, if you see that the database users are not populated in cPanel, you can try remapping them:
/usr/local/cpanel/bin/setupdbmap
No comments:
Post a Comment