After moving Wordpress, login works, but no admin access anymore

Found the perfect solution for me.

Problem was not with the migrating of the database to the new server but, if in migration prefix is different in old as well as in new database then the issue occurs!

My original database prefix was something like wp_71XXXXXX28_ and in the new installation, I was using wp_. Changing prefix only just solve the data part, but the log in issue still there as you have.

So, I just simply search for the old prefix in all tables using phpmyadmin search option for wp_71XXXXXX28_ and change the records to wp_.

Note: I found 5-6 matches in wp_user and 1 match in wp_option, yours might be different!


this may be because of you change the table name manually then this error show. so also change table prefix into the 'usermeta' table in 'meta_key' column

previousprefixthatyouchangeinnew_ to

  • yourPrefix_capability
  • yourprefix_user_level
  • yourprefix_user-settings
  • yourprefix_user-settings-time

your problem has been solved.