How to Fix WordPress “You do not have sufficient permissions to access this page” Error

So, you are having a hard time to resolve WordPress permission error, “You do not have sufficient permissions to access this page” right? There are many reasons that may cause WordPress permission error. I recently upgraded WordPress blog and then I was unable to login to WordPress admin area. I was using my admin user name and password.
[leaderboard_ads]
Here is one of the possible solution and that is that your wp_usermeta table is missing admin user role. To fix this error, you need to have access to your MYSQL database and you should be able to execute a query. Most website hosting companies provide PHPMyAdmin tool for managing your MySQL database.
Follow these steps to fix your WordPress permission error:
1. Login to your PHPMyAdmin or MySQL command line tool
2. Execute below query, if your WordPress table prefix is not wp_ then change it
INSERT INTO `wp_usermeta` ( `umeta_id` , `user_id` , `meta_key` , `meta_value` ) VALUES (NULL , '1', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}' );
[post_ads_2]If this solution does not work download newer version of WordPress from wordpress.org site, overwrite all files except wp-config.php, reset security keys in wp-config.php and then run following URL from your browser: http://YOURSITEURL.com/wp-admin/upgrade.php this will upgrade your database.
Before you try to overwrite any file, make sure you have a backup of your files and database. Some plugins may not work with newer version of WordPress.
Good luck!
[leaderboard_bottom_ads]
What type of server was this WordPress installation on? I have all of my installations running from a Linux server and have never seen this type of issue. I see it all over the place with Windows servers because of their automatic permission levels. Anyway, good to know there is a solution if I do see it!
It is a Linux server and permission error occurred when I accessed wordpress admin, It has nothing to do with windows permission.
I moved DB servers from Windows to Linux, and the table prexfix in the config had uppercase letters. So WordPress couldn’t locate the meta you detail as the table prefix is included in the key. Quick replace of the meta key with the correct prefix and all is well.
e.g. wp_S1_capabilities to wp_s1_capabilities
Thanks for pointing me in the right direction.