Fixing Wordpress “You do not have sufficient permissions to access this page.”
Posted by CPUFreak91 on August 13th, 2008 filed in Project Difficulty: Medium, Time Spent: Less than 1 hour, Web StuffI kept getting this error after I upgraded from WP 2.3 to WP 2.5 and restored its database.
I found the solution off of some guy’s blog. Works well!
Basically you have to know if you changed the prefix of your table names in WordPress after the migration.
From the blog:
In my old database, I used ‘wp_’ as my prefix. As I migrated, I decide to use ‘wp3_’ instead of ‘wp_’. Unfortunately, the meta_key values are tied down to:
wp_user_level
wp_capabilities
wp_autosave_draft_ids
I need to update it towp3_user_level
wp3_capabilities
wp3_autosave_draft_ids
I wrote an SQL statement to share, just replace ‘prefix_’ with your new WordPress prefix. The following statements go to ‘meta_key’ and does a string replace from ‘wp_’ to ‘prefix_’.UPDATE `prefix_usermeta` SET `meta_key` = REPLACE( `meta_key` , ‘wp_’, ‘prefix_’ );
(Make sure you do backups first! Note that the quotes used for string and field name are different.)
In the options table, there is ‘wp_user_roles’, make sure you get that changed into ‘prefix_user_roles’.
UPDATE `prefix_options` SET `option_name` = ‘prefix_user_roles’ WHERE `option_name` =’wp_user_roles’ AND `blog_id` =0;
(Make sure you do backups first! Note that the quotes used for string and field name are different.)
With everything set, I tried logging in again and it worked. A happy WordPress user once again. I am using WordPress 2.2.2 before the migration and I did not upgrade WordPress during the migration. Hope it helps. (Applies to WordPress 2.3.3 also.)
This works for 2.5 too
Leave a Comment
You must be logged in to post a comment.