Mark on WordPress

WordPress Error: You do not have sufficient permissions to access this page

Posted in wordpress by Mark Jaquith on March 28th, 2006

Some people, upon upgrading from WordPress 1.5.x to 2.0.x have been experiencing this error:

You do not have sufficient permissions to access this page

The most common cause of this error is an upgrade that didn’t complete. The database number has been incremented, so WordPress thinks it is up to date, but it hasn’t yet written the permissions that you will need to access the WordPress admin interface.

I have written a script to force the 1.5.x to 2.0.x upgrade.

Download

Force Upgrade for WordPress

Instructions

  1. Click “Download” and save as force-upgrade.php
  2. Upload force-upgrade.php to your WordPress root directory (the directory with wp-config.php)
  3. Access the file in your browser (e.g. http://example.com/wordpress/force-upgrade.php)
  4. Delete force-upgrade.php from your server

I won’t promise you that this will solve all your problems, but it has helped several people who have tried it. Let me know how you fare.

75 Responses to 'WordPress Error: You do not have sufficient permissions to access this page'

Subscribe to comments with RSS or TrackBack to 'WordPress Error: You do not have sufficient permissions to access this page'.

  1. Josh said, on April 9th, 2006 at 3:44 pm

    Hey, It Worked For Me!

  2. [...] I found this helpful post from Mark Jaquith where he provided a script to “force” the WordPress upgrade to finish. It worked perfectly and now I’m back in business. [...]

  3. Thom said, on May 2nd, 2006 at 11:51 pm

    Excellent job. Thanks so much for the assist.

  4. Maitri said, on May 18th, 2006 at 9:39 pm

    This is the sequence of events when I run your script. Thoughts? Thanks much!

    WordPress loaded…
    Upgrade functions loaded…
    Object cache flushed…

    Database made current…

    Fatal error: Call to undefined function: upgrade_160() in /home/vatulnet/public_html/blog/force-upgrade.php on line 35

  5. Maitri said, on May 18th, 2006 at 9:46 pm

    I guess I need a new upgrade-functions.php file with a definition for upgrade_160.

  6. Mark Jaquith said, on May 22nd, 2006 at 6:50 pm

    Yeah, you’ll need the latest version of WordPress with upgrade_160();

  7. Tom said, on June 3rd, 2006 at 3:18 am

    Hi Mark,
    Thanks for the script - gave it a spin but no joy. I am only encountering this issue with users who sign up to post comments. Admin is fine.

    Still hunting for a cure!

    All the best,
    Tom

  8. [...] [Update: Tried out the advice listed here, alas no joy as yet] [...]

  9. Mark Jaquith said, on June 3rd, 2006 at 4:38 am

    Tom,

    Possible problem:

    Maybe your default role (subscriber?) doesn’t have any capabilities. Try the Role Manager plugin (Google it) and make sure the Subscriber role looks correct.

  10. Tom said, on June 3rd, 2006 at 8:02 am

    Hey Mark,

    Thanks for that - installed the Red Alt version, and upped the permissions to allow a subscriber to “Edit Post” (closest thing to post comment I could see).

    Clicked on the “logged in” URL and it allowed me to login - yeah, unfortunately thrown straight back to the original post with no option to add anything.

    Curiouser and curiouser.

    Appreciate the heads up on the role manager - didn’t have a clue it was required.

    “Everyone is ignorant - only on different subjects…”

    All the best,
    Tom

  11. caipiracity said, on June 24th, 2006 at 12:11 pm

    man.. I LOVE YOU!THANKS I Resolved my problem!

  12. amsterdam said, on September 10th, 2006 at 10:21 am

    You’re a genius! Thanks!

  13. Eirik said, on September 25th, 2006 at 11:29 am

    seems to be working, thanks for making my day easier!

  14. [...] _ WordPress Error: You do not have sufficient permissions to access this page « Mark on WordPress Doing WP upgrades? Check it out… [...]

  15. Jennifer said, on December 22nd, 2006 at 10:01 pm

    Mark! THANK YOU!! OMG, I was freaking out. I’m finally going to start blogging on scripty again, upgraded to the latest version of WP, it failed, couldn’t access anything… this did the trick. THANK YOU THANK YOU THANK YOU!!!

  16. scriptygoddess » Overcoming the upgrade said, on December 23rd, 2006 at 2:25 am

    [...] 1) When I ran the upgrade, it sort of died before finishing… I refreshed and it told me it was all set. Checked on the main page, and everything seemed to be okay - but when I logged in to start tinkering around with the settings, I couldn’t log in completely. I got the dashboard with no navigation and then I clicked on something and all it wanted to do was send me to the profile page - but with nothing showing except “You do not have sufficient permissions to access this page”. Googled for a solution and found one on Mark’s site. Ran his script, and all was well again. [...]

  17. Colin Nederkoorn said, on January 8th, 2007 at 5:33 pm

    Thanks mark! It worked.

  18. [...] encontré esta página que explicaba el error, y pude [...]

  19. SkyLanD said, on January 25th, 2007 at 1:11 pm

    when i upgrade 2.0.5 to 2.1, i met the same problem, unfortunely, it doesnt work any more, can you write a new one to solve “to 2.1″problem?

  20. AveN said, on February 19th, 2007 at 6:11 pm

    did this… then i could log in.. but do not have admin-rights now :/

    WKR AveN

  21. alexus said, on April 9th, 2007 at 4:10 pm

    please help

    i moved my db, i added prefix to it, i went and manually changed wp-config.php and added my prefix there, but now it takes my username and password for wp-admin, but i get following error

    You do not have sufficient permissions to access this page.

    and i haven’t changed word press itself, i’m on same version

  22. echowebspace said, on April 10th, 2007 at 5:11 am

    From 1.5 to WordPress 2.1.3 it works! Useful script, thanks.

  23. Steve M said, on April 16th, 2007 at 7:12 am

    I tried using this software as I have had problems since attempting to upgrade from 1.5 to 2.1.3.

    Unfortunately, the problems still remain. My DB tables seem to be a mixture of 1.5 and 2.1

    When running force-upgrade.php, I got:

    WordPress loaded…
    Upgrade functions loaded…
    Object cache flushed…

    WordPress database error: [ALTER command denied to user 'smargolisbl'@'localhost' for table 'wp_categories']
    ALTER TABLE wp_categories ADD COLUMN link_count bigint(20) NOT NULL default ‘0′

    WordPress database error: [ALTER command denied to user 'smargolisbl'@'localhost' for table 'wp_categories']
    ALTER TABLE wp_categories ADD COLUMN posts_private tinyint(1) NOT NULL default ‘0′

    WordPress database error: [ALTER command denied to user 'smargolisbl'@'localhost' for table 'wp_categories']
    ALTER TABLE wp_categories ADD COLUMN links_private tinyint(1) NOT NULL default ‘0′

    WordPress database error: [ALTER command denied to user 'smargolisbl'@'localhost' for table 'wp_posts']
    ALTER TABLE wp_posts CHANGE COLUMN post_status post_status enum(’publish’,'draft’,'private’,’static’,'object’,'attachment’,'inherit’,'future’ ;) NOT NULL default ‘publish’

    WordPress database error: [ALTER command denied to user 'smargolisbl'@'localhost' for table 'wp_posts']
    ALTER TABLE wp_posts CHANGE COLUMN post_type post_type varchar(20) NOT NULL default ‘post’

    WordPress database error: [ALTER command denied to user 'smargolisbl'@'localhost' for table 'wp_posts']
    ALTER TABLE wp_posts ALTER COLUMN post_type SET DEFAULT ‘post’

    WordPress database error: [ALTER command denied to user 'smargolisbl'@'localhost' for table 'wp_posts']
    ALTER TABLE wp_posts ADD KEY type_status_date (post_type,post_status,post_date,ID)

    1. Added column wp_categories.link_count
    2. Added column wp_categories.posts_private
    3. Added column wp_categories.links_private
    4. Changed type of wp_posts.post_status from enum(’publish’,'draft’,'private’,’static’,'object’,'attachment’ ;) to enum(’publish’,'draft’,'private’,’static’,'object’,'attachment’,'inherit’,'future’ ;)
    5. Changed default value of wp_posts.post_type from to post
    6. Added index wp_posts KEY type_status_date (post_type,post_status,post_date,ID)

    Database made current…
    Data upgraded…
    Rewrite rules flushed…
    Object cache flushed…

    Hopefully that did it! DELETE THIS FILE FROM YOUR SERVER NOW!
    And then, try to access your /wp-admin/

    Any suggestions?
    Thanks

  24. Steve M said, on April 17th, 2007 at 4:57 am

    Update:

    I finally managed to fix this by clearing the database and starting with WordPress’ own ‘wp-content’ folder. Problem solved.

  25. Joe said, on May 29th, 2007 at 6:37 pm

    Thanks! worked for me in 2.2.

  26. [...] in Google op de foutmelding bevestigt (hier) situatie na manueel wijzigen van [...]

  27. danijelkurincic said, on June 4th, 2007 at 8:01 pm

    don’t know what really worked for me, but I deleted a “mailing-list.php” plugin file from the plugins folder because it was including the “upgrade-functions.php”, in which some function (don’t remeber which) was redeclared.,..

    Hell of a mess, I know. If anyone has mailing-list plugin and the same problem “not have sufficient permissions to access this page”, delete it!

  28. Ross Shannon said, on June 11th, 2007 at 12:48 pm

    For those who get this error randomly, without having upgraded WordPress recently, it’s caused by a database table being corrupted. Log in to MySQL and perform a repair using the syntax
    repair table tablename
    This fixed mine the first time I tried it.

  29. Mortenoc said, on July 10th, 2007 at 8:30 am

    Thanks. It worked fine with me.
    A clarification for the not-so-fast: The force-upgrade.php is to be run AFTER uploading the files of the new version to the server.

    Regards
    Mortenoc

  30. fms said, on July 20th, 2007 at 12:55 am

    Thanks heaps for this :)
    Fix my upgrade to 2.2.1

  31. Anthony Lynch said, on July 26th, 2007 at 12:36 pm

    worked well, thanks

  32. Utah Tech Jobs : Blog Backup Scare said, on August 19th, 2007 at 3:20 am

    [...] the googled the error code, and found Mark on wordpress’s force-install script. Which comes under the theory that wordpress didn’t complete an [...]

  33. The Doctor What said, on August 20th, 2007 at 11:11 am

    I have filed a bug to remove the $table_prefix in the column names which causes this problem in the first place.

    http://trac.wordpress.org/ticket/4780

    Ciao!

  34. ryder said, on September 26th, 2007 at 5:18 pm

    i hadn’t upgraded anything WordPress on my site in a couple years and yesterday i started getting the error after logging in to my admin page and trying to go to my profile (none of the usual menu items were there):

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

    I tried the script and now i can’t even get in to the admin page…

    urgh… any ideas would be GREATLY appreciated.

    thanks,
    ryder

  35. Periko said, on October 4th, 2007 at 5:59 am

    THANKS !!! YOU ARE A GENIOUS

  36. Bryan said, on October 11th, 2007 at 10:43 pm

    I used your upgrade script - and this got me further, but my admin account seemed to have no admin privs. All I could do was edit my profile - not post, nothing. I think the reason was that in the process of upgrading I also changed my blog prefix name. And this does bad things to wp_usermeta

    Here’s what I did to fix:
    Go into wp_usermeta in mysql and change all the meta_keys that proceed with the old blog prefix table name to the new blog prefix table name.

  37. Pritam said, on October 12th, 2007 at 2:57 pm

    can logged into the dashboard but dunno wat happened now, i can see only the dashboard and profile links there

  38. chris said, on October 20th, 2007 at 3:53 pm

    the download link is not working!

    http://txfx.net/files/wordpress/force-upgrade.phps

  39. CaffiNation Paul said, on November 2nd, 2007 at 3:27 pm

    Thank you so Much this is an awesome and clean fix.! My site http://www.caffination.com would not be up and running right now without you. Works for botched installs from wordpress 2.2.X - 2.3.1. Many thanks!

  40. Luther Blissett said, on November 6th, 2007 at 10:12 pm

    Awesome, thanks

  41. aj said, on November 17th, 2007 at 12:25 am

    what the hell! it worked! you are awesome man… :D cheers! :)

  42. Cedric Weber said, on November 20th, 2007 at 10:02 am

    Thanx!

  43. webringet.com said, on December 2nd, 2007 at 2:47 am

    good work, i’m not use it yet, but download it just in case i need it in near future

  44. [...] “You do not have sufficient permissions to access this page” поздравляю, вам сюда. addthis_url = location.href; addthis_title = document.title; addthis_pub = [...]

  45. cingular shop ringtones free ringtones from cingular cingular ringtones

    Whom get free ringtones for my cell phone advance cash lawsuit loan

  46. lawsuit settlement cash advance said, on December 14th, 2007 at 11:44 pm

    nokia composer ringtones free nokia tracfone ringtones

    As online cash advance info nextel remember ringtones

  47. jmie said, on December 18th, 2007 at 3:51 am

    Bryan - October 11, 2007 at 10:43 pm :I used your upgrade script - and this got me further, but my admin account seemed to have no admin privs. All I could do was edit my profile - not post, nothing. I think the reason was that in the process of upgrading I also changed my blog prefix name. And this does bad things to wp_usermeta

    Here’s what I did to fix:
    Go into wp_usermeta in mysql and change all the meta_keys that proceed with the old blog prefix table name to the new blog prefix table name.

    I have the same prob. The upgrade script worked, I also change the meta_keys of the old prefix table name.. I still don’t have the admin priviledges in admin account. I can’t edit posts. pls help!

  48. Paul Loke said, on December 18th, 2007 at 6:34 am

    Hi,

    Well done.

    It actually worked in fixing my WP 2.2 admin login problem. Before running the script, it keep complaining I have no permission to access the admin’s profile despite I am already using admin profile.

    FYI. I am using free hosting from http://www.freehostia.com.

  49. cash advance loan no faxing cash in advance loan

    Also quick cash payday loan baccarat software

  50. steven said, on January 24th, 2008 at 8:38 am

    I had same problem as paul loke and primas.
    after ran the scripts i got the error as primas. but progressed to admin page. but can’t see write , manage , etc option. Only dashboard and profile. Any solution ?

  51. poly klingeltne said, on January 24th, 2008 at 5:47 pm

    info nokia remember ringtones

    Is klingeltne per sms moniniset soittonet

  52. merchant services credit card processing said, on January 25th, 2008 at 1:11 pm

    free mobile motorola ringtones

    A best card credit secured 3.16 gold mp3 ringtones

  53. freie klingeltne

    No matter texas holdem starthnde advance card cash credit

  54. free cell phone ringtones game wallpaper said, on February 1st, 2008 at 1:04 pm

    Dear free verizon lg 3200 ringtones rainbow string represent 24 cell free phone ringtones kings white mechanic underlay dealer value 2366i nokia ringtones verizon tell semi zero shoe tournaments!

  55. realtone klingeltne said, on February 1st, 2008 at 1:42 pm

    Nowadays free us polyphonic ringtone croupier fold slow basic bank back free polyphonic ringtone for alltel circle railroad weak 100 gratis klingeltne speek kicker pocket symbols.

  56. 24 ringtones theme 24 theme ringtones said, on February 1st, 2008 at 2:06 pm

    Jugar poker regeln zum download Kugel paar gekommen overplay kostenloses online poker spiel Überbrücker Zweien rain Klaps Diamanten Banknotenrolle poker spiel lernen paigow steif Neutrales!

  57. inheritance cash advance said, on February 2nd, 2008 at 2:08 am

    poker superstars online game

    Morgen advance cash day pay advance cash day in loan pay uk

  58. cell free phone upload wallpaper said, on February 2nd, 2008 at 2:58 am

    cell free phone razr wallpaper

    Unhappily free polyphonic ringtone for nokia 3560 free motorola cellular phone wallpaper

  59. sonneries tlphone said, on February 2nd, 2008 at 3:16 am

    des jeux de poker telecharger

    Thanks polyphone klingeltne downloaden les rgles de jeu poker

  60. adleras said, on March 6th, 2008 at 12:32 pm

    this topic is not used and moderated anymore? … i also have some problems..but as i can see..nobody is here anymore :(

  61. polyphonic ringtones for sony ericsson said, on March 15th, 2008 at 3:07 am

    download free ringtones tracfone

    Each free sprint sanyo ringtones dash mobile ringtones t

  62. sweeteorgiapeaches said, on March 16th, 2008 at 2:41 pm

    yikes
    it came in as a quicktime file.php
    granted i dont understand any of this but that seems weird.
    will you call me
    213-435-3665
    thanks,
    marion

  63. [...] then coba search googling dan nemu cara buat membereskan masalah itu. Masuk aja disini cukup download dan upload filenya lalu dijalanin. Ntar uotputnya kayak gini: WordPress [...]

  64. Leen said, on April 3rd, 2008 at 2:07 pm

    Did the job for me! Perfect! Thanks a lot!

  65. dHEKU said, on April 9th, 2008 at 9:08 am

    OBRIGADO!
    thankx a lot!
    você salvou minha vida =DD

    o/

  66. John said, on April 9th, 2008 at 7:33 pm

    I am trying to install a new theme in word press 2.o but any theme i chose it comes up with an error “Broken Theme” and “style.css is unreadable”.
    Any comments much appreciated.

  67. Maurito said, on April 10th, 2008 at 10:37 am

    Works for me!!Thanks
    Funciono barbaro gracias por la info!!

  68. Olaf said, on April 10th, 2008 at 7:52 pm

    ohh maaan thx!!!!!!

  69. aviation art said, on April 13th, 2008 at 5:12 am

    I’ve upgraded to WP 2.5 but I’m still unable to get rid of this error message and am still locked out of the admin module. I’ve tried all the fixes suggested on this page :(

    What else can be done? Is the WP crew unaware of this problem that seems to be affecting so many people and are they not working on a fix for it?

    Hopefully, they are, otherwise I’ll have to replace my blog script with another, more stable platform.

  70. Biju said, on April 15th, 2008 at 2:36 pm

    Thank, it worked.

  71. Twelfth St. Media said, on April 16th, 2008 at 3:31 pm

    worked for me! Thank you for taking the time to help us out. It is much appreciated.

    -J

  72. Pierrot said, on April 21st, 2008 at 4:21 pm

    Not only did it not work but it completely wiped clean all of the content from my website. You’re shitty little piece of code may help some people but the damage it does to others is greater.

  73. Tom said, on April 30th, 2008 at 5:40 pm

    Thank You very much for saving me another big headache! Thank You!

  74. SumOf.Us said, on May 5th, 2008 at 6:29 am

    FIXED!!!!

    OK gang - if you run the script and can then LOGIN but only get the Dashboard and Profile, you must do 2 things

    1) In you wp_usermeta table make sure your meta_key entries are correct (e.g. wp_capabilities and wp_userlevel on a default configuration.

    2) delete the extra wp_capabilities entries the script has added to the end of your table. by default if will add a:1:{s:13:”subscriber”;b:1;} to your wp_capabilities - which makes your admin account a subscriber only.

  75. [...] Well, this was difficult. I have been using a blog on blogger, but since I have subscribed to a webhost I wanted to host my own blog. Easy right? No, not so… Seems that the installation of wordpress fails to add an admin user correctly. Took me ages to find out how to do it. But for a solution look here. [...]

Leave a Reply