After moving Wordpress, the login works, but there is no more access to the administrator

After transferring wordpress from the old Internet service provider to the new Internet service provider, I have problems with administrator access / access to the control panel.

The transfer was performed by copying all the files (including .htaccess) from the old server to the new server, resetting the old database and placing it on the new server, and setting up all the settings for the database in wp-config.php.

By setting the host entry on my computer, I can verify that everything is working fine and that all the content appears.

Here is my problem.

After logging into wp-login.php with old and new credentials (for example, an administrator account is added manually), you log in, redirect me to the site, confirm successful login using the login panel at the top of the page, but access to the dashboard is prohibited by indication.

Sorry, you are not allowed to access this page. 

There are also almost no parameters in the entry bar, except for switching to wordpress.com or logging out.

This is probably just a small thing, and I only need someone who points me in the right direction.

+12
source share
7 answers

It turns out that this is a bug in Wordpress 4.6.1 when using your own prefix for DB table names.

Rename the wp_ prefix and change the table names and it will work.

+6
source

Found the perfect solution for me.

The problem was not the transfer of the database to the new server, but if the migration prefix is ​​different in both the old and the new database, the problem arises!

My original database prefix was something like wp_71XXXXXX28_, and in the new installation I used wp_ . Changing the prefix only solves a part of the data, but the logon problem still exists.

So, I'm just looking for the old prefix in all tables using the phpmyadmin search option for wp_71XXXXXX28_ and changing the entries to wp_ .

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

+17
source

It looks like your problem is with a manually created admin account. The error message that you see indicates to me that there is a problem with the rights assigned to the user.

Can you tell us more about the steps you took to add an account manually?

I assume that you added the user directly to the users table, but after that did you add features and user level information to the usermeta table?

To give you an example, if I create a user, I would run a query to insert the user into the wp_users (assuming we are in the standard table prefix).

Then I get the identifier of my newly created user and use it to insert two new lines in wp_usermeta .

umeta_id must be NULL, and user_id must be the identifier of your new user for both entries.

 1) meta_key: wp_capabilities meta_value: a:1:{s:13:"administrator";s:1:"1";} 2) meta_key: wp_user_level meta_value: 10 

Further reading: http://www.wpbeginner.com/wp-tutorials/how-to-add-an-admin-user-to-the-wordpress-database-via-mysql/

+7
source

this may be due to the fact that you change the name of the table manually, and then this error message. therefore also change the table prefix to the "usermeta" table in the "meta_key" column

previousprefixthatyouchangeinnew_ to

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

Your problem has been resolved.

+7
source

I also came across this post after migration.

It looks like the database prefix is ​​case sensitive, and if it doesn't match exactly, this is what appears when you try to access the administration pages.

Make sure you check your config.php file and configure it as a table prefix.

If you use phpMyAdmin to check tables, you should notice that all table names in the database tree are displayed in lower case, while the expected prefix was in the upper case.


phpMyAdmin image: phpMyAdmin

The correct prefix in the image is the one that should be used.

I used the table "<fixes> _usermeta" to get the expected WP prefix.

+2
source

For those who are still looking for the right answer in my case, this is what I did to solve the problem of not being able to log in to WordPress Dashboard.

In the database table "wp_options" under the option name "wp_user_roles" there were no standard features. Copy these features from a database backup or from a clean WordPress database.

+1
source

When you use search and replace on the dumped .sql file of the original Wordpress site to use it on a new one, be sure to cover everything. I had the same problem and checking the wp_usermeta table, in the meta_key column I found several keys named after the prefix of the old table. Replacing them fixed my problem.

0
source

All Articles