Tuesday, January 12, 2010

WORDPRESS: How to solve ‘You do not have sufficient permission to access this page.'

Case 1:
We install the same wordpress file in new server.
But we change the prefix of the database. After setup everything, the website page cannot be display. Error occur.

Solution:
  1. Open database that have been use for this wordpress using phpmyadmin.
  2. Search url: www.address.edu.my dalam db
  3. Change all address to new address :www4.address.edu.my
    Probably inside:
    wp_options

  4. But after change all the address to the new one, the admin page cannot be open.
    There some error said:'You do not have sufficient permission to access this page.'

How to solve ‘You do not have sufficient permission to access this page.'

After seacrhing all the possible solution from the internet, finally we found the solution in this site: http://beconfused.com

Because we change the prefix of the table names in WordPress after the migration, thats why the error occurs.

In my old database, I used ‘wp_’ as my prefix. As I migrated, I decide to use ‘newprefix_’ instead of ‘wp_’. Unfortunately, the meta_key values are tied down to:
  • wp_user_level
  • wp_capabilities
  • wp_autosave_draft_ids
So, we need to update it to
  • newprefix_user_level
  • newprefix_capabilities
  • newprefix_autosave_draft_ids

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


(** Dont forget to do backups first! Note that the quotes used for string and field name are different. )


Not finish yet! This another one statement you need to do also.


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;



Try it, I tried logging in again and it worked. Thank you very much to http://beconfused.com


After successfully open the admin page, we run the upgrade automatically after deactivate all the current active plugins. All run very well without error.

But after check back all the links inside the website page, we found this error again:

WordPress 404 Not Found Problem

I already post this solution in my last year post. Refer the solution there.
http://salinaitmind.blogspot.com/2009/07/wordpress-move-site-to-new-server-issue.html

After that, every links can work fine. Alhamdulillah...



.

0 comments:

Post a Comment