"not allowed to access this page” when opening the wp-admin page

I wanted to do some tests and I migrated WordPress to Localhost. Now I can only see the old fashion default page ( using the Jupiter theme) and I get “Sorry you are not allowed to access this page” when opening the wp-admin page. Tried deactivating plugins, removing .htaccess file from old root doc, adding new user details in wp- user and wp-usermeta tables, no result. What else can I try?

I had same issue and now solved…
– I created a new admin user in the database
– I logged in to admin no problem with the new username
– To my surprise, I found that my original user’s role was showing as “None”. I am not sure how this happened, is it possible the recent update corrupted the database tables, or could it be a hack? Once I changed the role back to “admin”, I was able to log in as my old user, so I delete the new one which is no longer needed.

I am still confused as to how this happened and I’d quite like to know for future reference, but I’m relieved to be back in.