I ran across a WordPress error after moving a database from a local install (XAMPPlite) to a live server.
You do not have sufficient permissions to access this page
Now this was a puzzle. The kind of puzzle you don’t enjoy getting when you know everything should be working fine.
The following is my unfortunate tale and, while the 1st part may not specifically apply to the above error, it has a bearing on the solution, so bear with me.
The Setup
Here are the steps I took up to the point of getting this error:
- Using the tutorials found here and here, I exported my local MySQL database, created a new database on the server (using Plesk)
- Replaced all mentions of localhost in my exported SQL file with the actual address of the live site
- Imported the local database into the newly created one
- Made some adjustments to the wp_options table and others to make sure the URLs and paths were correct
- Then I uploaded my WordPress files and edited my wp-config.php file and added the correct database info
At that point, it should’ve worked. But it didn’t. I couldn’t even get a single page to load.
Case Matters (Apparently)
When setting up WordPress on my local install via XAMPPlite, I used wp311guP_ (obviously not exactly what I had, for obvious reasons) as the table prefix for WordPress instead of the standard prefix, for security reasons.
Come to find out, the table prefix had gotten changed ever so slightly when the database was created and setup with WordPress.
Example (again, not the actual values I used, obviously ;) ):
The original table prefix I had set: wp311guP_
Table prefix as it was recorded by MySQL: wp311gup_
Notice: For some reason the last letter was changed from a capital P to a lowercase p. I haven’t been able to find any WordPress or MySQL documentation that mentions this, though I haven’t searched too deeply.
Tables? We Don’t Need No Stinking Tables
WordPress couldn’t get connected correctly to the database because it was looking for tables with a prefix that didn’t exist. I changed the table prefix to the lowercase version in wp-config.php because this was easier and faster that going through and replacing all the capital letters in my WordPress database.
Once I made my changes I could view the front page. Huzzah!
But sadly when I entered my login info, I got:
“You do not have sufficient permissions to access this page”
A Solution
After searching on Google for an answer, I found a post on beconfused.com.
The jist of the post is that he ran into similar problems. His problems were a result of manually changing the table prefix for security reasons. To fix things, he had to go into his database and change some of the values to fix the permissions error he was getting when logging in.
This wasn’t exactly what had happened to me, and yet it was the same basic issue.
Looking through his post though, I checked my own database for:
- wp_user_level
- wp_capabilities
I noticed that even though everywhere else the table prefix had been changed to wp311gup_ (lowercase p), in those sections it was still my original wp311guP_ (uppercase P).
Anyhow, I searched and changed all the uppercase versions of the table prefix to the lowercase version and it fixed my WordPress login permissions error.
other Possibilities
My above issue might not be why you’re getting the WordPress permissions error. If you’re getting that error, here are some other possibilities.
No .htaccess File?
If you’re receiving an permissions error, you may also want to check that you have .htaccess in your main WordPress directory. This can also sometimes cause you problems.
Upgrading Problems?
If you’re upgrading from a previous version of WordPress and you get the permissions error, you might look at this solution.
The Conclusion
If you’re going to use a different table prefix than the default (which you should for security reasons), you might want to steer clear of using capital letters in it. They may well be converted to lowercase in the majority of MySQL tables, yet the login tables may leave the capital letter(s) in tact and cause you grief.
Also, the lowercase/uppercase issue may only rear its ugly head once you go to put the site live—I never had a noticeable problem when testing using XAMPPlite.
I’m curious: Has anyone else run into this issue with table prefix characters changing?
Anyone else use uppercase characters in their WordPress tables?
Has anyone found mention of issues with uppercase characters in MySQL table prefixes?
{openx:7}


28 Comments to 'WordPress Error: You do not have sufficient permissions to access this page'
June 18th, 2009
Thanks for pointing me in the right direction. I had the ‘You do not have sufficient permissions to access this page’ message after running the WP Security Scan plugin on WP2.8. Suffice to say I won;t be using it to modify my db again!
December 15th, 2009
Let’s me try this tips
December 22nd, 2009
Yes, I have run into the same problem, but not because of capitalization, but rather because I was renaming the database prefix to something different (still lowercase) through a plugin called WP Security Scan. I have not yet solved the problem, but I am getting the same “You do not have sufficient permissions to access this page.” message you had.
December 23rd, 2009
hey, good post and i also like your page layout too. Bookmarked your site and will stop by again,:)
January 28th, 2010
Hey there – Great post! But I’ve had no luck :(
I’m attempting to re-produce my WP Install and Site locally for testing and development.
I’ve got everthing rockin’:
Virtual Host is set for local.domain.org
Site files & WP content work.
BUT on log-in I get the permission error.
I’ve tried the Password reset via the myPHP [http://codex.wordpress.org/Resetting_Your_Password]
I modified the .htaccess
As the post you linked to recommended.
Nothin.
I would greatly appreciate any input or direction.
March 9th, 2010
Moved the db and had the same problem I fixed it by noticing that under wp_user the id of the admin was 2, when I changed it to ID=1 everything worked. I tried every fix I could find on the web and this did the trick no I don’t know why it just worked.
March 10th, 2010
I was able to revert to my original wp_usermeta and the problem was resolved.
I had installed a basic WP on my site and then uploaded my style and plugins. I then used my local phpMyAdmin with MAMP to export my DB.
Using phpMyAdmin on the server I then imported the DB. Fortunately/unfortunately I had given the two DB’s different names. Using the SQL tab and the following script I changed the original name to old; and the newDB name to the original.
RENAME TABLE wp_usermeta TO wp_old_usermeta;
RENAME TABLE wp_imported_usermeta TO wp_usermeta;
If I had the tables named the same this may not have been an issue?? Then again it might have been worse since I would not have a back up.
After doing this I got the nasty “You do not have sufficient permissions to access this page” when I tried to login
So, I reverted the wp_usermeta file and all was good again.
*note: I did swap the wp_post and other tables so that my new data was used.
Thanks for the post.
March 14th, 2010
there is something more about this problem.
u have to change some names in wp_options table too.
http://www.neoegm.com/tech/wor.....wordpress/
May 3rd, 2010
also this link has the exact resolution I needed for the above problem:
http://www.tech-evangelist.com.....rmissions/
May 18th, 2010
[...] to get rid of. There are a lot of sites that indicate the problem is with a failed upgrade or misnamed database tables,but for me it was simply an issue with an old plugin and wasn’t happening anywhere [...]
May 29th, 2010
I imported the mysql table ‘_users’ and happened the same problem: “You do not have sufficient permissions access to this page.
I looked that in the table ‘_usermeta’ is not consumers who was imported in table ‘_users’.
This problem is solved – join the site as the ‘admin’ and on Control Panel ‘Users’ settings assignment to users any role, such as the ‘Subscriber’.
That’s it – all imported, users can connect to the Webpage as in mysql table ‘_usermeta’ now have the necessary records.
*NOTE: you must have the original records in mysql tables ‘_users’ and ‘_usermeta’ of user ‘admin’.
Sorry for my poor english :)
June 20th, 2010
I don’t know what to do with this error..
:(
June 24th, 2010
@emptybetweenears – thx that solution rocked!
June 27th, 2010
Thanks for the post! The error occured when I updated the prefix manually in phpMyAdmin.
@emptybetweenears thanks for your input. I went to the site and the generator worked great.
September 10th, 2010
[...] did not give any clues so I resorted to searching the web and came up with information from ESDeveloped which referred me onto Beconfused. They suggested the clue was a couple of characters awry in one [...]
September 27th, 2010
Thank you! Thank you!
I had the same problem importing from my WAMP install on local machine. I actually had a capital letter before and after the underscore (_) of my table prefix. And I found places in php myadmin where the capital before the underscore was still capitalized, but in wp-config all letters were lowercase.
So instead of searching php myadmin (I had imported the database from my local install), I just deleted the tables from php myadmin, edited the exported sql file for all instances of the table prefix using global find/replace to use only lowercase, then imported to my production server.
Worked a hoot!!! I will be posting this url to the wordpress.org support site, I did not find any clues there.
September 29th, 2010
I’m glad it helped, Steve. Sometimes Google’n a solution’s your best best.
Glad you found the site.
December 8th, 2010
Yikes!
Just got it after installing Wp Security Scan plugin on localhost setup. Noticed that it made the prefix I suggested all lowercase in the database, but left it as I suggested—with some caps—in the wp-config.php file.
Now, I can’t even get to the admin login page.
Don’t know how to fix it.
January 8th, 2011
I found this via Google, and you solved a problem I couldn’t figure out! Thanks for the details. I had changed my own wp tables prefix in the database for reasons I won’t go into and thought I had taken care of everything when I edited my config file. I didn’t realize there were records in the tables I’d have to change too. :) Again, thanks.
January 18th, 2011
Thanks for keeping this post up! I needed to use a few of the solutions and I only lost half a head of hair.
January 25th, 2011
Hello,
I also had this problem after running the table prefix change on WP Security Scan.
The problem turned out to be an issue with the wp_capabilities plugin. This plugin creates some entries in the _usermeta table with the wp_ prefix. These entries must be changed manually with an SQL query something like this:
UPDATE newprefix_usermeta SET meta_key = ‘newprefix_capabilities’ WHERE meta_key = ‘wp_capabilities’;
Be on the lookout for other plugins that may exhibit this problem.
February 18th, 2011
@emptybetweenears – YES! That was it- update the prefixes in the usermeta table AND the options table. Thank you!
April 21st, 2011
I ran the security plug on my brand new shiny wordpress blog. It promptly borked it. I have 3.1.1 and the tables were consolidated in prefix_usermeta.
There are serveral columns in there that reference other tables in word press which the security plug in does NOT update :/
WHOO! I can get back to the admin panel at least…
There is a colum called metakey in the usermeta table. The following fields still retained the old
prefix:
capabilities
user_level
user_settings
user_settings_time
I manually updated them to reflect my new table prefix and so far *knock on wood* it seems to be working.
Thanks for the post. At least I knew where to start looking :)
August 19th, 2011
Very helpful article! It helped me secure my weblog. Thanks!
December 12th, 2011
THANK YOU! THANK YOU THANK YOU THANK YOU!!!
December 13th, 2011
Thank you thanks you ! for this post; my problem was solved by the .htaccess file…..
March 25th, 2012
I am facing a problem of “not sufficient permission to access the page” after I emptied the wp_usermeta db. Are they related. How do i rectify (I did the .htaccess but did not work)
June 1st, 2012
Thank you very much. I didn’t notice that there is no .htaccess in my wordpress.
In addition I have changed the folder of my plugin,which I couldn’t enter, to something shorter and without uppercase characters and itt worked for me.