To harden an old WordPress site, the first thing I did was change the table prefix to something other than wp_
But that somehow turned every user from admin to subscriber, now I was locked out. And when I tried to login, it redirected me to the homepage, not the wp-admin section. Here’s what I did:
First, grab this script, put it into a php file named, force-upgrade.php , by Mark Jaquith and upload it to the same directory as your wp-config file. Then visit that directory/force-upgrade.php It will prompt you to run the script. “Hopefully that does the trick.” – But you still need to change your permission via phpMyAdmin, skip past this script to do that.
To change your role to admin, edit the following sql script to what you need and run it in the SQL tab in phpMyAdmin