You do not have sufficient permissions to access this page

Recently, I migrated this blog to another webhost: FatCow.com. Upon migrated, accessing to DashBoard of my blog is refused and showing an error: “You do not have sufficient permissions to access this page”.

However, this blog continue working for public, which mean visitors can view posts and pages.

I tried to repair and re-install WordPress again, but all attempts were failed. What I did was:

1) Verify files & folders permission (755, 644), which everything was in right place.

2) Re-examine and remove .htaccess file.

3) Rename “plugins” folder and remove unnecessary plugins.

Later, I remembered that I had renamed WP tables and changed the prefix in wp_config. Apparently I needed to change something inside some of the tables.

Finally, I found the solution here:
how to solve you do not have sufficient permissions to access this page in WordPress.

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_’ );

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;

above quotes are copied from beconfused.com

footnote:
this post is to keep for myself, should I need to migrate to another webhost in future.

Posted in WordPress Tagged with: ,

Leave a Reply