4
Jul/09
7

“You do not have sufficient permissions to access this page” after Wordpress upgrade

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 4.50 out of 5)
Loading ... Loading ...

If you’ve done a wordpress upgrade which included either copying another wp database or changing the current one’s table prefix (as well as changing the $table_prefix PHP variable in your config file,) you will most likely be met with this warning when you try to log in:

You do not have sufficient permissions to access this page.

The reason for this is that everything in wordpress that accesses info in the db does so from PHP using the $table_prefix variable, and when you first installed your blog, a couple of options are set in the database that include that value, which makes it not really so dynamic! ;)

After rooting through my db, I found 5 or 6 values that still had the old table prefix in – mostly in the `usermeta` table, but also one in the `options` table. To make sure I got them all, I ran these simple SQL statements in phpMyAdmin to update all the values:

UPDATE `wp2_usermeta` SET `meta_key` = REPLACE(`meta_key`, 'wp_', 'wp2_');
UPDATE `wp2_options` SET `option_name` = REPLACE(`option_name`, 'wp_', 'wp2_');

(note: please be sure to backup your database before you execute any SQL on it – if something goes wrong, there’s not a lot you can do to recover it without a backup!)

In those two examples, assume the original prefix was “wp” and the new one is “wp2″.

With that done, I can now log in to my newly upgraded blog again! :)

Comments (7) Trackbacks (1)
  1. tom
    4:34 am on July 16th, 2009

    hey I seem to be getting this error message when I try to access the options and configuration for this plugin:

    softsift.com/thumbnail-summary-plugin

    I was wondering if you can help me fix this so that I can access this plugin from my settings panel of wordpress 2.8.2

    all of my other plugs work and can be accessed under the settings panel of wordpress admin. but this one doesnt for some reason

  2. Cody
    11:32 am on July 16th, 2009

    It just don’t make sense to me, plain damn weird…

  3. Jon
    5:48 pm on July 21st, 2009
  4. Quogmagof
    3:50 pm on July 25th, 2009

    hmmm, great post

  5. Mark
    4:37 pm on August 28th, 2009

    Thanks man! Pffew, I thought I had messed up my DB after changing the prefix…

  6. James Chorlton
    9:31 pm on February 11th, 2010

    Great help after I changed the table prefix on my install.

    Thanks!!

  7. Aaron
    1:42 am on February 26th, 2010

    Thanks so much! You saved me a lot of hassle sleuthing this one out.

Leave a comment

Healthspark