After upgrading my wordpress blog and changing the prefix of my tables to something other than wp_ (which is recommended for security reasons), I found that I got the following error message when I tried to log in:
You do not have sufficient permissions to access this page.
After searching around, I found this blog post which despite being two years old and clearly referencing an older version of wordpress, it indicated exactly what the problem was. There were values in my database that had not been renamed to the new prefix and were still expecting to be referenced by the old one. By following the advice from the user “Joshua Szanto”, whose comment is replicated below, I was able to locate the values in my database that had not been updated accordingly.
RENAME TABLE wp_comments TO qb_comments;
RENAME TABLE wp_links TO qb_links;
RENAME TABLE wp_options TO qb_options;
RENAME TABLE wp_postmeta TO qb_postmeta;
RENAME TABLE wp_posts TO qb_posts;
RENAME TABLE wp_terms TO qb_terms;
RENAME TABLE wp_term_relationships TO qb_term_relationships;
RENAME TABLE wp_term_taxonomy TO qb_term_taxonomy;
RENAME TABLE wp_usermeta TO qb_usermeta;
RENAME TABLE wp_users TO qb_users;
RENAME TABLE wp_wp_bible TO qb_wp_bible;UPDATE `qb_usermeta` SET `meta_key` = REPLACE( `meta_key` , ‘wp_’, ‘qb_’ );
UPDATE `qb_options` SET `option_name` = ‘qb_user_roles’ WHERE `option_name` =’wp_user_roles’ AND `blog_id` =0;
If you’re having trouble getting your wordpress blog to log in after you have changed your table prefix and the above doesn’t help you, a good place to start would be to look for references to your old prefix and update them to your new one.