WordPress Error: Sorry, you are not allowed to access this page.

You face this problem when you log in to the admin page. This usually happens when you make changes to plugin/theme.

Sorry, you are not allowed to access this page.

I have spent quite a fair amount of time trying to troubleshooting this and it seems that some database has been changed resulting in this problem.

1) Go to phpMyAdmin
2) Look under _options table
3) Search for _user_roles. You should be able to see the first prefix is the same as your main table. If it is different, change it to the same prefix as your table.

Try it out.