Aug
28

How to solve ‘You do not have sufficient permissions to access this page.’ in WordPress

uncategorized

I have been running into troubles logging in to WordPress and was kinda frustrated all morning.

Basically each time I use tried to log in, I get:

You do not have sufficient permissions to access this page.

I could not edit the blog, nothing works except the front page. I did a couple of searches at Google but the solutions didn’t seem to work for me.

In the end, I did a new installation of WordPress and scrutinized every damn thing in the users and usermeta table between a database that worked and a database that doesn’t.

Did you change the prefix of your table names in WordPress after the migration?

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 to

  • wp3_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, lately, it seems to be working for WordPress 2.9 also.)

Possibly related:

  1. WordPress 2.3.2 released!
  2. point//three
  3. short//disruption

Tags: , , ,

220 comments for “How to solve ‘You do not have sufficient permissions to access this page.’ in WordPress”

  1. Awesome fix you posted! With your clear instructions, I had it corrected in under 2 min. Thanks again.

    by dealasite (Aug 29, 2007 at 11 PM)
  2. You’re most welcome! Glad it helped. :D

    by Mr. Dew (Aug 30, 2007 at 2 AM)
  3. Thank you very much for yout tip. It saved me hours.
    Regards.

    by François-Xavier Bodin (Oct 4, 2007 at 6 PM)
  4. Wow – I was having exactly the same problem. This solved it! Thanks a bunch!

    by Arjun Prabhu (Oct 5, 2007 at 5 AM)
  5. Thanks for posting this information. I moved my WordPress database and changed the prefix; the prefix thing is what got me. You saved me potentially hours of working trying to find the cause of my problem. Thanks again!

    by Brian Jarrett (Nov 5, 2007 at 5 AM)
  6. Thanks – saved me ages!

    by Julian (Feb 7, 2008 at 7 PM)
  7. [...] How to solve ‘You do not have sufficient permissions to access this page.’ in WordPr…If you rename the datbase table prefixes on an existing installation you will get bitten bu this. Simple fix takes a couple of minutes. wordpress howto [...]

    by Synesthesia » Links roundup for 2008-02-07 (Feb 8, 2008 at 8 AM)
  8. thanks a lot!!!!

    by piko (Feb 20, 2008 at 7 AM)
  9. ditto to all of the above. the admin for my Volleyball news site is now open for business once again – thanks to your tips.

    cheers
    Paul

    by Paul (Mar 3, 2008 at 10 AM)
  10. I owe you a beer! Thanks :)

    by Jacob Friis Saxberg (Mar 24, 2008 at 9 PM)
  11. Thanks for the help. Is there anywhere online where this design decision is explained? Is there a bug filed in Trac for this issue?

    by The Plaid Cow (Apr 3, 2008 at 12 PM)
  12. That was great info!

    I also found such records in the wp_options table as well, when trying to migrate, so whoever reads this be careful and look twice.

    by Takis (Apr 5, 2008 at 12 AM)
  13. Thanks for this info. Saved me a hard night of headaches. I was migrating one of my ebay wp sites into a new db. Glad I came across this.

    Big Mahalos to you!

    by chris (Apr 14, 2008 at 12 PM)
  14. Thanks this worked great.. thank god for Google and your blog post. :)

    Oliver Antosch
    from http://www.chinese-course.com/

    by Oliver (Apr 20, 2008 at 4 PM)
  15. nicely done, nicely done

    by WOOHOOO!!! (Apr 26, 2008 at 10 AM)
  16. Thank-you for posting this, it just saved me hours of head scratching!

    by Thomas M (May 2, 2008 at 12 AM)
  17. wow, thanks a lot! :)

    by andrea (May 3, 2008 at 3 AM)
  18. Thanks, your post saved me from getting a few more grey hairs.

    by David Valentiate (May 9, 2008 at 1 AM)
  19. thanks !! i was wondering how to get out of this mess myself..

    cheers,
    tom

    by tom (May 16, 2008 at 2 PM)
  20. fwiw, i tried both this approach and also mark’s approach (link above my comment) and neither worked. I finally imported the old version of my database and while the table names stayed the new name, I am now finally able to access admin functions! YEAH!

    by kathy (Jun 10, 2008 at 11 AM)
  21. Yeah, this doesn’t work for me either. Looks like it no longer works with current WP installations (2.5.1).

    by anysia (Jun 17, 2008 at 4 AM)
  22. I love you! I love you i love you i love you! It’s 5 am here and I’ve been panicking since I saw that error and google wasn’t helping then I saw this! I’m so glad you decided to share this, thank you so much.

    by Seluna (Jun 19, 2008 at 5 AM)
  23. Thanks, it’s work for me.
    I use this method directly with phpmyadmin and nothing difficult to do that.
    Thanks a lot.

    by lutfi (Jun 23, 2008 at 2 AM)
  24. Thank you, thank you, thank you!!!
    I spent AGES today trying to work this out – thanks!!!!!

    by Lorraine (Jun 25, 2008 at 8 AM)
  25. Saved me some headache, thanks for the great post.

    by zer0day (Jul 25, 2008 at 4 AM)
  26. did wordpress developers remove the prefix embedding from the table values in 2.5+? or are they continuing to keep wordpress as fucked as it always has been for every-13th-weekend warriors?

    by blow bird (Jul 31, 2008 at 3 PM)
  27. Just what I needed to fix my blog, thanks for the tips.

    by Adam Backstrom (Aug 7, 2008 at 1 AM)
  28. Thanks for the tips, so I could fix it in 5 minutes.

    But I used navicat for mac. Just get into the tables and changed the prefix in the 4 fields. No need to write sql statements.

    by filmbox (Aug 12, 2008 at 8 PM)
  29. I did the SQL here — and the force-upgrade.php from http://markjaquith.wordpress.com/2006/03/28/wordpress-error-you-do-not-have-sufficient-permissions-to-access-this-page/ — and was still having problems.

    Then I decided to look carefully at the prefix_usermeta database table, where I discovered that there were two records for prefix_capabilities. One had ‘administrator,’ the other ‘editor.’ I deleted the one with ‘editor.’ That finally fixed the problem.

    I’m not sure why there should have been two prefix_capabilities records. I wonder, however, if either the update process itself or force-upgrade.php may have inserted the additional record when it found no appropriate one because of the old prefix on the capabilities record…

    I suspect that all of the above was necessary for me. Perhaps it could possibly happen to someone else, also. Therefore this post.

    by Mike Green (Aug 16, 2008 at 4 AM)
  30. Very nice. Thanks :-)

    by kimalders (Aug 18, 2008 at 2 PM)
  31. will it work for 2.6 too :(

    by chandan (Aug 18, 2008 at 9 PM)
  32. I had the same problem. My solution was to re-edit the SECRET KEY section of the wp-config.php.

    You will need to put the SECRET KEY code above this line in wp-config.php

    /* That’s all, stop editing! Happy blogging. */

    by AW (Sep 14, 2008 at 9 AM)
  33. Thank you very much, I was installing a new plugin and had to migrate an existing blog into the new tables and was giving me many problems. This was the last problem and was about to give up – thanks!

    by Kerry (Sep 18, 2008 at 1 PM)
  34. thanks, this tip helped.

    by Joe (Sep 19, 2008 at 12 AM)
  35. A problem we hadn’t dealt with before, this was a very useful guide!

    by Dave (Sep 20, 2008 at 9 PM)
  36. Thank you so much, I’ve solved my issue.

    by California SR22 (Sep 21, 2008 at 10 AM)
  37. Thanks much for figuring this out!

    by Charlie R (Sep 25, 2008 at 2 AM)
  38. Just saved me from hours of troubleshooting!

    Thanks a bunch! :D

    by timkl (Oct 2, 2008 at 7 PM)
  39. Brilliant. Thanks for this info. Worked flawlessly.

    by Aaron forgue (Oct 14, 2008 at 11 PM)
  40. I still can’t get it to work, after adding Secret key, changing prefixes in all the db’s… This is wearing me down…

    by sven (Oct 17, 2008 at 7 PM)
  41. Thanks. It works for me.

    by Steve (Oct 24, 2008 at 4 PM)
  42. Just fixed my 2.6.2 version with your tips… this would have been a real bear to track down without your help. Much appreciated.

    by Ron Amundson (Oct 26, 2008 at 11 PM)
  43. is it possible to move multiple wordpress into one database and have different prefixes for each site?

    by Barry Main (Oct 28, 2008 at 11 PM)
  44. A great post, I don’t know a great deal about sql but this really helped me transfer my wordpress site in no time.

    Many thanks for the instructions

    by Water (Nov 2, 2008 at 11 PM)
  45. Thanks a bunch! You saved my bacon.

    by Mark (Nov 21, 2008 at 10 AM)
  46. This worked perfectly for us, well done.

    by Packyourbags (Dec 4, 2008 at 2 PM)
  47. Dear Mr. Dew you can add me to the list of fellows that owe you one for this post. If you come to Montreal, Quebec, please contact me and I’ll be glad to take you for a free lunch.

    by Christian Aubry (Dec 13, 2008 at 12 PM)
  48. Woo hoo! Thanks SO much for writing this out. I had the same problem and this fixed it up in a jiffy!

    by weave (Dec 19, 2008 at 8 AM)
  49. Thanks dear…..
    I owe you big time….
    Thanks again….

    by Nikhil Gupta (Dec 22, 2008 at 8 PM)
  50. Thanks man! If you’re in South Florida, I will take you out for a beer or three!

    by Otavio Fonseca (Dec 25, 2008 at 9 AM)
  51. Thanks
    you’re a timesaver !

    by Kristof (Dec 27, 2008 at 10 PM)
  52. Thanks! Saved me some pain too :)

    by Boris (Jan 4, 2009 at 9 PM)
  53. Thank You, Thank You, Thank You!

    I was about ready to pull my hair out on this one!!! Thanks for providing all the details! Especially the fact that you also need to update the wp_options table and change the “wp_user_roles” option_name to match your new prefix_…!

    Thank You, Thank You, Thank You!!!!!!!!!!!!!!!!!

    by DPC (Jan 26, 2009 at 12 PM)
  54. Thank you! Also working in WP 2.7!

    by Daniel (Jan 28, 2009 at 4 AM)
  55. Was doing some real complicated backup and recovery stuff and this one was a real blow… thanks a ton for your post it got my sunken ship sailing again :)

    by Sanjay M (Feb 8, 2009 at 2 AM)
  56. Thanks for the write-up. Had an oooold WP site to sort out that was doing this because of a migration. Saved me working out how to fix it. Well done.

    by David Coveney (Feb 10, 2009 at 12 AM)
  57. This didn’t fix my frontend – but it did fix my backend so I could export all my pages to an XML file!

    Much appreciated!

    by Ben (Feb 10, 2009 at 10 AM)
  58. I tried everything, then went to phpmyadmin went to the wp_table then wp_user roles opened that up and compared it with my other working blogs found a difference changed it and it worked!!!! ok in the text on the second line it should be a:53: INSTEAS of a:51: simple now everything works!!!!

    by Lambros (Feb 15, 2009 at 6 AM)
  59. This is what I did to convert “wb_” to “qb_”:

    RENAME TABLE wp_comments TO qb_comments;
    RENAME TABLE wp_links TO qb_links;
    RENAME TABLE wp_options TO qb_options;
    RENAME TABLE wp_postmeta TO qb_postmeta;
    RENAME TABLE wp_posts TO qb_posts;
    RENAME TABLE wp_terms TO qb_terms;
    RENAME TABLE wp_term_relationships TO qb_term_relationships;
    RENAME TABLE wp_term_taxonomy TO qb_term_taxonomy;
    RENAME TABLE wp_usermeta TO qb_usermeta;
    RENAME TABLE wp_users TO qb_users;
    RENAME TABLE wp_wp_bible TO qb_wp_bible;

    UPDATE `qb_usermeta` SET `meta_key` = REPLACE( `meta_key` , ‘wp_’, ‘qb_’ );

    UPDATE `qb_options` SET `option_name` = ‘qb_user_roles’ WHERE `option_name` =’wp_user_roles’ AND `blog_id` =0;

    by Joshua Szanto (Mar 7, 2009 at 6 AM)
  60. [...] Si como yo deciden cambiarle el prefijo a las tablas de su WordPress ya instalado: How to solve ‘You do not have sufficient permissions to access this page.’ in WordPress [...]

    by Dieresys » Blog Archive » Securizando WordPress (Mar 8, 2009 at 3 AM)
  61. As with the first post, a year and a half ago, this was an excellent post with clear instructions. Worked perfectly for WP 2.7.1 after I changed my table prefixes.

    by Gary (Mar 9, 2009 at 5 PM)
  62. Thank you for the post, it solved my problem too!

    by Istvan (Mar 15, 2009 at 8 AM)
  63. i have tried this — biut i am stil geting the error. it is only happening at 2.7,1

    by butter (Mar 21, 2009 at 2 AM)
  64. I figured I’d add to the pile of hundreds of developers thanking you: THANK YOU! This saved me hours. Kudos.

    by John Rockefeller (Mar 26, 2009 at 8 AM)
  65. You are a star, i have been banging my head against a wall for days now, your fix worked perfectly, thanks.

    by Norton (Mar 26, 2009 at 10 PM)
  66. You saved me from hours of work here MrDrew. Thanks alot for posting this!

    by nomark (Mar 27, 2009 at 4 AM)
  67. THANK YOU!! I was having puppies trying to figure this out. You rock!

    by Michelle (Apr 11, 2009 at 6 AM)
  68. Thanks it helped me a lot

    by Harsh Agrawal (Apr 14, 2009 at 4 PM)
  69. THank you..helped me out !

    by Shoaib (Apr 16, 2009 at 2 AM)
  70. [...] 这次搬家过程可谓是麻烦不断,先是mysql4-mysql5的编码问题折腾半天,之后又发现登录后台提示我‘You do not have sufficient permissions to access this page.’  直接扔到google里面立刻发现答案:原来问题在于我修改了wp数据库表明的前缀,除去修改wp-config.php文件外,数据库里面的部分数据也需要更新,文章作者也给出了sql语句,转载如下: [...]

    by 登录wordpress后台出现‘You do not have sufficient permissions to access this page.’的解决办法 at gkp’s post (Apr 20, 2009 at 3 PM)
  71. Thank you so much for this quick fix! I’m new to WordPress and changed my table prefix since I read an article on WordPress.com that might make the WP installation safer (security through obscurity thing). And the next thing it locks me out of the admin area…

    by Andrew (Apr 26, 2009 at 5 AM)
  72. thank you kindly sir! was pretty confused by this one and your solution worked perfectly. :)

    by matt mcinvale (Apr 28, 2009 at 1 AM)
  73. Thank you for your greate work!

    by Travor (May 13, 2009 at 10 AM)
  74. Thanks a lot! My issue is solved.

    I moved a friend’s blog to GoDaddy hosting. Before the move, I updated the SQL file as much as possible, but clearly these changes were unexpected.

    Now the blog is up and running again!

    by Rajib Ghosh (May 21, 2009 at 12 PM)
  75. [...] 带着问题google了一下,在这里发现了答案: How to solve ‘You do not have sufficient permissions to access this page.’ in WordPress [...]

    by 数据库表名错误导致无法访问blog - KangKang2 (Jun 6, 2009 at 11 PM)
  76. Excellent upgrading to 2.8 I decided to run the secure plugin and it knocked off admin – this solved it perfectly

    Many thanks

    by Mike (Jun 11, 2009 at 10 PM)
  77. Woo!! Thank you :)

    by Matt Rogowski (Jun 14, 2009 at 5 AM)
  78. Thanks for this fix! Seemed a bit strange to me that you have to do this by hand, but it was done quickly and worked like a charm.

    by Martin (Jun 14, 2009 at 4 PM)
  79. Thanks for posting this.
    That security plugin had locked me out.

    by radian (Jun 17, 2009 at 9 PM)
  80. I did the same as Mike above, thanks for posting this – great!

    by Neil (Jun 18, 2009 at 6 PM)
  81. Thanks a lot !! You saved my day so efficiently !! Thousand thanks ^^

    by David (Jun 26, 2009 at 5 PM)
  82. excellent thanks :)

    by limca (Jun 27, 2009 at 3 PM)
  83. Great! You save me some horribles and frustrating debugging hours !

    by kabye (Jul 4, 2009 at 10 PM)
  84. take my kiss…
    u save my ass…
    many thanks.

    by emonweb (Jul 9, 2009 at 7 PM)
  85. Another huge thanks! I was about ready to reinstall, when Google found this- still works with WP2.8.

    by Chris Bryant (Jul 9, 2009 at 9 PM)
  86. You just saved me from parsing through the whole prefix_options table. Awesome job!

    Thanks!

    by Ian Atkin (Jul 13, 2009 at 10 AM)
  87. Thanks, a couple of old prefixes were causing trouble when moving a WP 2.7 site – good tip.

    by Karl (Jul 16, 2009 at 5 PM)
  88. As everybody else above, I want to thank you for saving my day :)

    by BaroqueW (Jul 17, 2009 at 6 PM)
  89. Thanks, this just saved me a good few mins of time.

    by james (Jul 21, 2009 at 7 PM)
  90. Thax a lot. IOU a bear. You are the hero of myy day.

    by Peter Shaw (Jul 22, 2009 at 6 AM)
  91. Thanks, and confirming this fix works on wordpress v2.8.2

    by ZachWeg (Jul 23, 2009 at 5 AM)
  92. You absolute hero! mwah!

    by Jimmy (Jul 23, 2009 at 6 PM)
  93. Almost 2 years after you originally posted this, you’re still helping people out of that daunting “You do not have sufficient permissions” error message.

    Thanks for helping me out too!

    Cheers,
    - Lee

    by Lee Kelleher (Jul 24, 2009 at 6 AM)
  94. Thanks for this! Reinstalling would not have been an option for me.

    by Jens Walter (Jul 24, 2009 at 10 PM)
  95. WOW!!! Thank you very much for this one!! I was almost desperate, but this thing actually works! Thank you man!

    I build up a new database, imported the last export and then used the Query on top of this page… Voila, Bob’s your uncle!

    Greetings from Holland!

    by Frank (Aug 4, 2009 at 2 AM)
  96. [...] table prefixes which disallows you to login to your Dashboard. There’s a brilliant article here that helped me fix my [...]

    by WP Security Scanner plugin and Second IP Address! | The Eggshell (Aug 9, 2009 at 11 PM)
  97. Thank you very much for this!

    I had every part of your solution with the exception of updating the options table. You saved me a lot of time!

    by Jeremy (Aug 13, 2009 at 10 AM)
  98. Thanks very much :)

    by charlieb (Aug 15, 2009 at 1 AM)
  99. Thanks for posting this! Made for a quick fix to my issue.

    by Toluallii Nielsen (Aug 15, 2009 at 8 AM)
  100. If I ever meet you in person, remind me to buy you a beer!

    by crashsystems (Aug 18, 2009 at 11 AM)
  101. You rock guy!!!

    by Jonny (Aug 18, 2009 at 5 PM)
  102. Thanks so much! Although I had very recent backups, you saved me a lot of work and possible downtime.

    by David Di Gioia (Aug 22, 2009 at 9 AM)
  103. [...] lot of the info on the wordpress site doesn’t really cover this issue. Luckly, this does. Basically, you need to go into the “usermeta” table, and change the [...]

    by Everybody Staze… » Moving wordpress tables (Aug 23, 2009 at 10 AM)
  104. Worked like a charm for me with an upgrade to WP 2.8.4 and a change of prefix.

    Thank you so much!

    by David Hartley (Aug 23, 2009 at 11 PM)
  105. Great fix. Tango mike!

    by Anthony Burns (Aug 24, 2009 at 7 PM)
  106. Just ran into this very problem. Your fix worked great! Thank you!!

    by Jennifer (Aug 29, 2009 at 4 AM)
  107. Phew, thanks! Was getting a bit worried for a moment.

    by Robert Dyson (Aug 29, 2009 at 12 PM)
  108. [...] 可能的问题是 $_usermeta这个数据表中的数据问题:需要改成新的:老外解决方案 [...]

    by J.et wong’s stuff » wordpress 的移植出现的问题 (Aug 30, 2009 at 4 PM)
  109. thanks a lot. its save my time :)

    by coconut (Aug 30, 2009 at 7 PM)
  110. Thanks a lot from Finland! You saved my night. Now I can go to sleep. :)

    by Mikis (Aug 31, 2009 at 5 AM)
  111. Really, really helpful post. Thanks for writing these easy-to-follow instructions!

    by David Chambers (Sep 6, 2009 at 4 PM)
  112. You are a lifesaver…

    by Jake (Sep 9, 2009 at 10 PM)
  113. Thanks so much–years later, still very useful.

    by Josh (Sep 11, 2009 at 5 AM)
  114. You saved me quite a bit of work, thanks!

    by Anne (Sep 11, 2009 at 10 AM)
  115. Thanks for the help when trying to upgrade.

    You is da man

    Alex

    by Alex:: Home Life Weekly (Sep 13, 2009 at 6 AM)
  116. This post helped me too. Was cofused by the UPDATE queries at first. Thanks.

    by Slawa (Sep 14, 2009 at 5 PM)
  117. Brilliant! Worked perfectly on WordPress 2.8.4.

    by Mango (Sep 21, 2009 at 12 AM)
  118. Thanks.
    u saved my ass! :)

    by Murali Kumar (Sep 21, 2009 at 8 PM)
  119. It worked like a charm thanks a lot. This was the third or fourth post I read on this issue, until I found your solution.

    by trendmxseo (Sep 25, 2009 at 4 PM)
  120. thanks a lot, mate. saver!

    by Lima (Sep 25, 2009 at 9 PM)
  121. –Thanks! Been trying to rebuild my blog and this was a great help.

    by Tim C (Sep 29, 2009 at 8 AM)
  122. Thank you!!!
    Although, for WP 2.8.3 the second step could not be done. no wp_user_roles option name.
    Everything worked!!

    THANK YOU!!

    by odyodyodys (Oct 8, 2009 at 9 PM)
  123. Thanks! A new little thing to know about WP!

    by G100g (Oct 9, 2009 at 4 PM)
  124. thank you so much. this saved my day! :)

    many greetings from germany, and thanks again!

    by maery (Oct 12, 2009 at 2 AM)
  125. Thanks! Your simple sql script saved me.
    And also learned the hidden logic about table prefix. :D

    by slw4qd (Oct 16, 2009 at 1 PM)
  126. Thanks for taking the time to provide the SQL statements – not only did you tell us what the problem was, you gave us a quick and easy solution.

    by jack (Oct 22, 2009 at 12 PM)
  127. gee dude,
    thanks for that
    i was almost reinstalling!

    by brasofilo (Oct 22, 2009 at 4 PM)
  128. :) Thank you :)

    by Kredyty (Nov 5, 2009 at 6 PM)
  129. Thank you. Consider this a cyber hug from me to you.

    by Bob (Nov 6, 2009 at 9 AM)
  130. Thank you, I updated my prefix for security reasons and then had the permission problem. This blog was very useful!

    by BandonRandon (Nov 19, 2009 at 8 AM)
  131. thank you very much ^__^

    by phie2t (Nov 20, 2009 at 5 PM)
  132. it soved for me :)

    by chandan (Nov 26, 2009 at 4 PM)
  133. Thanks a lot! Saved me from more headaches, great fix.

    by Andy (Nov 30, 2009 at 6 AM)
  134. [...] of table prefix – I suggest you visit this to solve that problem. And it also solves a string of other things, [...]

    by WordPress : ‘You do not have sufficient permissions to access this page’ « Kwatog Interactive (Dec 2, 2009 at 6 PM)
  135. You absolute star, I’d changed the DB prefix to create a dev site without creating a new database, and the dev installation just didn’t work. Lovely bit of SQL to correct the problem.

    Thanks again.

    Oliver.

    by Oliver (Dec 4, 2009 at 12 AM)
  136. Thanks for the query. Saved me a lot of aggravation & time.

    by Brett (Dec 6, 2009 at 3 AM)
  137. thanks, your article really helped my problem

    by ianhade (Dec 14, 2009 at 3 AM)
  138. Thanks very much for posting this. I downloaded WP Security and let it ‘do its thing’. Little did I know that it would not do everything it needed to – which locked me out of my Admin Console.. Nice.. I ran your update script and it works fine now! THx.

    by DJ (Dec 25, 2009 at 8 PM)
  139. After i change the DB prefix with WP Security Scan plugin i had the same error. But this is great and solved the problem, but there wasn’t anything to chang in wp_options, but worked fine anyway :)

    by Killedbymonkeys (Jan 9, 2010 at 7 AM)
  140. [...] etc so there was nothing that looked wrong. So I headed to Google where I found an article at beconfused about the same [...]

    by Rob Watson | WP admin error: You do not have sufficient permissions to access this page. (Jan 10, 2010 at 7 PM)
  141. Still works today. If you change the prefix of your tables for easier management; as I did. Use this article to run the sql commands required to relink your admin site.

    by solarblu (Jan 15, 2010 at 5 AM)
  142. Edit table wp_usermeta
    and change value of wp_capabilities to

    a:1:{s:13:”administrator”;b:1;}

    done :-)

    by Pedro Lobito (Jan 22, 2010 at 9 AM)
  143. Thank you – works beautifully again now…

    by Mark (Jan 27, 2010 at 12 PM)
  144. Dude, this post totally saved my life tonight. Thanks!

    by Charles (Jan 29, 2010 at 12 AM)
  145. Let me thank you in advance for your help! Since this site obviously seems to be very helpful.

    I’m not a developer so when I ran into the “sufficient permissions” access restriction message, I kinda freaked out and just deleted the plugin via FTP. That didn’t solve anything; I’m still locked out. Too bad I didn’t google the answer first! Darn it.

    Now I’m trying to replace my current/buggy wp_1 prefix that is jamming everything up with the simple wp_ prefix. I am using phpMyAdmin 3.1.2 and am wondering if anyone could provide precise “go here then there” instructions as to solve this issue. I’d hugely appreciate it. I’ve posted to several forums in the last 72 hours since the problem erupted and haven’t had a single reply yet.

    Again, THANK YOU in advance!

    by opal (Jan 31, 2010 at 9 AM)
  146. Thank you! This was a great fix. I didn’t know how to run/execute SQL statements or what that means, but I manually edited the SQL entries via php MyAdmin, and that did the trick!

    by Jacob (Feb 8, 2010 at 4 AM)
  147. Thanks, saved me too.

    by ali (Feb 17, 2010 at 7 AM)
  148. Ah! My solution! Sir — if ever you want a beer in the borough of Queens, that beer shall be put in your hand on my dime.

    by Brendan McGinley (Feb 17, 2010 at 10 AM)
  149. thanks, you saved me some hours… i changed all the prefixex directly in the the database through phpmyadmin – worked perfectly in wordpress 2.9.2

    by erwin (Feb 22, 2010 at 12 AM)
  150. Thanks alot, made my day!

    by Marcus Lindberg (Feb 22, 2010 at 6 PM)
  151. Just want to say THANKS A MILLION!!!!

    More power and God bless

    by zplits (Mar 1, 2010 at 10 PM)
  152. Thanks for this post: it helped me to resolve the problems.

    by Alain Sips (Mar 19, 2010 at 6 PM)
  153. I seem to be missing something with the instructions and I’m hoping someone can help.

    I ran the wp security scan plugin and changed the table prefix from wp_ as suggested. Then I ran into problems and cannot access my database. It sounds like your fix is just what I need to resolve my issue.

    However I can’t log into phpMyAdmin since I changed the table prefix’s so I’m not sure how to run the SQL statements.

    Any help would be appreciated–Thanks!

    by Tammy Wilson (Apr 2, 2010 at 7 AM)
  154. saved my life! thanks =]

    by Chris Slowik (Apr 6, 2010 at 3 AM)
  155. Thank you! I used a security plugin to change my db prefix and it didn’t catch those user meta key values. Thanks for sharing this critical bit of knowledge.

    by Paris Vega (Apr 12, 2010 at 2 AM)
  156. Yep! Praise for this post. I work with wordpress all the time but was moderately confounded by this problem tonight.

    Thanks so much for your very clear instructions. I’m bookmarking this one, for sure. :)

    by Marj Wyatt (Apr 12, 2010 at 6 PM)
  157. I WASTED 7 hours trying to figure it out myself, i HAVE DONE EVERYTHING YOU THOUGHT WAS POSSIBLE…

    BUT UNFORTUNATELY I CHOSE TO TRY YOUR METHOD LAST JUST BECAUSE YOUR PAGE SEEMED TOOOO LONG.. BUT ACTUALLY IT WAS THE COMMENTS THAT MADE IT LOOKED THAT WAY…

    anyway, thanks… and i’m still pissed things JUST NEVER EVER WORK OUT till i’m super pissed and super tired!!!

    by pissed of... (Apr 29, 2010 at 12 AM)
  158. Thank you sooooooo much!!!! I have been fighting this problem all day and was to the point that I was about to start crying.

    by Stephanie (May 1, 2010 at 7 AM)
  159. Beautiful. Probably saved me an hour or more of WTF and head-scratching….

    by Michael Johnston (May 3, 2010 at 9 PM)
  160. Huge thanks! You saved my day.

    by Napych (May 12, 2010 at 7 PM)
  161. Thanks!!!

    Used the command-line mysql to perform the changes. I only needed to change the ‘prefix_usermeta’ table as the ‘prefix_options’ table was already changed by the plug-in.

    :-)

    by Patrick Kalkman (May 13, 2010 at 2 PM)
  162. This post was a lifesaver! I stumbled it with a review. I am so grateful to people like you who take the time to document what you’ve learned. :)

    by Marj Wyatt (May 21, 2010 at 3 PM)
  163. useful article … problem has been resolved … thank you:) (sorry for my English, I translated with google translator)

    by agebit (May 31, 2010 at 10 PM)
  164. Thx! Saved me a lot of time… Superb fix!

    by ekin06 (Jun 7, 2010 at 5 PM)
  165. Thank you so much for posting this – you are an absolute star!

    May the walls of your house never fall in and the people within them never fall out

    by David Wainwright (Jul 24, 2010 at 4 AM)
  166. THANKS!!! Had it not been for Google and finding your article I would’ve spent hours troubleshooting this problem. I can’t thank you enough!

    by David (Jul 27, 2010 at 11 AM)
  167. I should also point out that it worked on my WordPress v3.0 and MYSQL Version : 5.1.43. THANKS AGAIN!!

    by David (Jul 27, 2010 at 11 AM)
  168. Thanx! Used this to extract a multi site wp 3.0 blog into a single installed blog. Renaming wp_x_ back to wp_

    by Digitalux (Aug 4, 2010 at 3 AM)
  169. This rocked, it totally made everything work on a “merged-but-separate” website!

    by Josh (Aug 12, 2010 at 1 AM)
  170. This is a life saving post. I was in a state of panic before your post. Thanks

    by Eyebol (Sep 4, 2010 at 9 AM)
  171. Thanks a lot!
    Used those queries when my WP 3 refused to let me in after moving to another server. Great post :)

    by slalomas (Sep 7, 2010 at 4 AM)
  172. thanks for saving me a headache!

    by paul (Sep 18, 2010 at 3 AM)
  173. Thanks Mate, this was really help full, when i wanted to use multiple WP db in a single database

    by Maddy (Sep 20, 2010 at 9 PM)
  174. thanks my colleague’s wordpress site got hacked and I had to replicate the wp database, change all prefixes and connect his wp site to the new db. so naturally the linkages were all broken. Your post helped me to track them down quickly.

    by greg (Oct 5, 2010 at 6 AM)
  175. Thanks John, that worked a treat

    by yebo (Oct 8, 2010 at 12 AM)
  176. Very helpfull, your sql strings work perfectly (WordPress 2.9.1)

    by Fa (Oct 8, 2010 at 6 AM)
  177. You just totally saved me with this post, even 3 years later. Thank you so much for posting this solution!

    by April Silver (Oct 26, 2010 at 8 PM)
  178. regarding wordpress version 3.0.2:

    This fix still applies. there are now 5 applicable fields in the usermeta table:
    wp_capabilities
    wp_user_level
    wp_dashboard_quick_press_last_post_id
    wp_user-settings
    wp_user-settings-time

    and still just the one in options:
    wp_user_roles

    by axlotl (Dec 7, 2010 at 6 AM)
  179. thanks – this page keeps giving. I installed WP Security and my access stopped.

    by kris (Dec 29, 2010 at 11 AM)
  180. Thanks, saved me too.

    by noclegi (Dec 29, 2010 at 9 PM)
  181. Saved me a lot of time. Thanks!

    by paulsmithx (Jan 14, 2011 at 10 PM)
  182. Thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you

    by Andy (Jan 16, 2011 at 8 AM)
  183. Still valid in 2011 year with WordPress 3.0.4, thank you for sharing those tidbids of knowledge!

    by Jacaranda (Jan 31, 2011 at 5 AM)
  184. Thanks! It saved me :)

    by Louis (Feb 24, 2011 at 9 PM)
  185. Thank you so much!

    by David (Feb 26, 2011 at 1 AM)
  186. Thanks. Fixed my site after changing prefix’. This should really be incorporated into semper fi’s tool.

    by surlyjake (Mar 1, 2011 at 1 AM)
  187. Ahhh, you’re a genius! Thanks!

    by Michael (Mar 4, 2011 at 9 PM)
  188. Thank you so much! Your code saved my day. I had installed a second blog on a website and didn’t realize that if I had a different prefix to the table I’d need to update it in the database.

    - Heather

    by Heather Goff (Mar 31, 2011 at 5 AM)
  189. thanks… worked like a charm

    by Björn (Apr 12, 2011 at 8 AM)
  190. Awesome tip! Thanks a lot!
    *took it into bookmarks*

    by kostya (Apr 19, 2011 at 5 PM)
  191. thanks for that, i wasted a morning with this problem, good to know your looking out for us :)

    by Jason L Cook (May 19, 2011 at 8 PM)
  192. thanx..budy…..thank you very much….

    by nitish (May 26, 2011 at 2 AM)
  193. tnx,still works like a charm.

    by Franek (May 30, 2011 at 8 PM)
  194. thank you!
    it worked perfectly on a few 3.1.3 wp installs
    thanks!

    by jerome (Jun 3, 2011 at 6 PM)
  195. Thank you – worked a treat after I changed my table prefix. Thanks!!

    by Joe Smalley (Jun 12, 2011 at 6 PM)
  196. Thank you for this quick fix, it worked a treat on my 4.1.4 install after I changed the prefix.

    Thanks again!

    by Mark (Jul 1, 2011 at 3 PM)
  197. Thanks a lot, I almost kill my self before I read your post. Complete in just 1 minute…You’re good..

    by ipank (Jul 14, 2011 at 9 AM)
  198. wonderful,i wasted around 2 hours to get rid out of this situation. thanx

    by Tech Frill (Jul 15, 2011 at 11 PM)
  199. Thanks a lot for this! You saved me quite a lot of time of research :-)

    by Francis Robert (Jul 26, 2011 at 2 AM)
  200. Thank you very much…. :)

    by Abhi Kumar (Aug 1, 2011 at 3 PM)
  201. Great thanks.
    Works for me using 3.2.1

    by Puthut Agus Yunianto (Aug 8, 2011 at 11 PM)
  202. Hi

    I got this same problem this morning, updated my PHP and my dev site and broke everything. Had to reinstall wordpress but nothing was working. Got this error message and did your fix of changing the prefix table names and it now works.

    Thanks.

    by Paul Underwood (Aug 14, 2011 at 6 PM)
  203. Very useful article! It helped me secure my weblog successfully, and saved much googling time. Thanks a ton! :)

    by Hemant Arora (Aug 19, 2011 at 5 PM)
  204. Thank you very much, you saved my life

    by Williams Orellana (Aug 25, 2011 at 11 AM)
  205. Like everyone else has said… you saved me tons of time. I hope you are living a happy life because you just made mine better! Ran your SQL scripts and it fixed my WP login errors. Thanks!

    by Michael Garcia (Sep 9, 2011 at 10 AM)
  206. Works for me too. Awesome fix. THANKS!

    by Bill Weems (Sep 17, 2011 at 9 AM)
  207. Thanks so much for this post…really save me time searching what is wrong with my wp installation.. :D It’s still working for WordPress Version 3.2.1.

    by beba (Sep 21, 2011 at 1 AM)
  208. thanks for this usefull information, now i can worpressing again,, :)

    by cnwintech (Oct 2, 2011 at 4 PM)
  209. thanx mate
    saved a lot of time

    by carrol (Oct 12, 2011 at 9 PM)
  210. You posted this solution on Aug, 2007 and IT’S STILL HAPPENING!

    But it worked great. Thank you, thank you, thank you for giving me the hours and hours it would have taken me otherwise back to my life.

    by Terry (Nov 3, 2011 at 8 AM)
  211. This post is a live saver! I love wordpress, but little problems like this or how to bulk delete comments, do drive me crazy.

    by Jason (Nov 10, 2011 at 7 PM)
  212. You sir, rock. You just saved me a whole bunch of hassle, this was exactly my issue!

    by Chris (Nov 20, 2011 at 10 AM)
  213. Fantastic explanation! Thank you very much for this post!

    by Martin Krcho (Nov 23, 2011 at 5 AM)
  214. Thank you! You saved my life. Now I’m facing the other theme of my wordpress.

    by Photo Booth (Dec 1, 2011 at 7 PM)
  215. I had this problem after moving a website to a new hosting company.

    When importing the MySQL data, the database prefix had changed to lower case. All I need to do was amend my config.php file to match.

    Of course it took me hours to figure that out.

    by Jason King (Dec 1, 2011 at 11 PM)
  216. thanks you very much :)

    by francis (Dec 14, 2011 at 6 PM)
 

Leave a Reply

Please leave these two fields as-is:

 

Comments may be moderated due to spam. No advertisements are allowed in comments.

You'll require some math knowledge to comment, this is done to stop evil bots from spamming my blog.

Read my comments policy

Want a display picture?