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.
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”
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:
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.
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.
If you’re upgrading from a previous version of WordPress and you get the permissions error, you might look at this solution.
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?