WordPress-我无法登录-wp_users表出了点问题 [英] WordPress - I can't login - Something wrong with the wp_users table

查看:493
本文介绍了WordPress-我无法登录-wp_users表出了点问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法登录管理控制台.当我转到localhost/nutri/wp-admin时,它会自动将我重定向到:

I can't login to the admin dashboard. When I go to localhost/nutri/wp-admin, it automatically redirects me to:

http://localhost/nutri/wp-login.php?redirect_to=http%3A%2F%2Flocalhost%2Fnutri%2Fwp-admin%2F&reauth=1

,当我尝试登录时,它只是将我重定向回相同的URL.它在屏幕上不显示任何错误消息.如果我尝试使用错误的详细信息登录,那么它的确会提供通常不正确的用户名或密码消息,因此这不是登录详细信息的问题.

and when I try to login, it just redirects me back to that same URL. It doesn't give any error message on the screen. If I try to login with incorrect details, then it does give the usual incorrect username or password message, so this isn't a problem with the login details.

WP_DEBUG已打开,但屏幕上未显示任何错误消息.但是每次我尝试登录时,都会在error_log.php中出现一个新错误:

WP_DEBUG is on but no error messages are appearing on the screen. But a new error appears in error_log.php every time I try to login:

[2016年10月1日22:01:31 UTC] WordPress数据库错误为查询"INSERT INTO wp_usermeta(user_idmeta_keymeta_value)"值重复键"PRIMARY"的条目"0" (31,'session_tokens','a:1:{s:64:\"430df13e6700f4ec995ca5f4eb5901886b39db5225975bcef392002b27173629 \"; a:4:{s:10:\"expiration \"; i:1475532091; s:2:\"ip \ ; s:3:\" :: 1 \; s:2:\" ua \; s:73:\" Mozilla/5.0(Windows NT 10.0; WOW64; rv:49.0)Gecko/20100101 Firefox/49.0由wp_signon,wp_set_auth_cookie,WP_Session_Tokens-> create,WP_Session_Tokens-> update,WP_User_Meta_Session_Tokens-> update_session,WP_User_Meta_Session_Tokens->创建的\; s:5:\" login \; i:1475359291;}}') ,add_metadata

[01-Oct-2016 22:01:31 UTC] WordPress database error Duplicate entry '0' for key 'PRIMARY' for query INSERT INTO wp_usermeta (user_id, meta_key, meta_value) VALUES (31, 'session_tokens', 'a:1:{s:64:\"430df13e6700f4ec995ca5f4eb5901886b39db5225975bcef392002b27173629\";a:4:{s:10:\"expiration\";i:1475532091;s:2:\"ip\";s:3:\"::1\";s:2:\"ua\";s:73:\"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0\";s:5:\"login\";i:1475359291;}}') made by wp_signon, wp_set_auth_cookie, WP_Session_Tokens->create, WP_Session_Tokens->update, WP_User_Meta_Session_Tokens->update_session, WP_User_Meta_Session_Tokens->update_sessions, update_user_meta, update_metadata, add_metadata

昨天我通过管理仪表板添加了一个新成员,今天,当我进入phpmyadmin中的wp_users表(尝试手动重置密码)时,我注意到输入的新用户的ID为0.我删除了那排.今天,我尝试通过注册表格注册一个新帐户.新帐户的ID再次为0.如果我删除了该帐户并注册了新用户,则会发生相同的事情: https://i.gyazo.com/c3daabb414f620f1b6c11c1d199a1d39.png

Yesterday I added a new member through the admin dashboard, and today when I went into the wp_users table in phpmyadmin (to try manually resetting my password) and I noticed that the new user I entered had an ID of 0. I deleted that row. Today I tried registering a new account through my registration form. The new account again had an ID of 0. If I delete it, and register a new user, the same thing happens: https://i.gyazo.com/c3daabb414f620f1b6c11c1d199a1d39.png

如果我尝试添加新用户而不删除ID = 0帐户,则会在屏幕上收到此错误消息:

If I try adding a new user without deleting the ID=0 account, I get this error message on screen:

WordPress数据库错误:[键"PRIMARY"的条目"0"重复) 插入wp_users(user_passuser_emailuser_urluser_nicenamedisplay_nameuser_registereduser_login)值('$ P $ Bj1pCG4T8VksjjeeD.dx8Qu0p9l7RT.','root @ ftes .com','','rootftes-com','root@ftes.com','2016-10-01 21:48:42','root@ftes.com')

WordPress database error: [Duplicate entry '0' for key 'PRIMARY'] INSERT INTO wp_users (user_pass, user_email, user_url, user_nicename, display_name, user_registered, user_login) VALUES ('$P$Bj1pCG4T8VksjjeeD.dx8Qu0p9l7RT.', 'root@ftes.com', '', 'rootftes-com', 'root@ftes.com', '2016-10-01 21:48:42', 'root@ftes.com')

我尝试禁用所有插件,并尝试停用主题,但没有一个起作用.我尝试安装wp-login.php的新版本.

I tried disabling all plugins and I tried deactivating the theme but none of that worked. I tried installing a fresh version of wp-login.php.

因此,问题与wp_users表有关,但我不知道如何进一步诊断或解决此问题.它可以在实时服务器上正常运行,但是我担心现在要上传我的更改,以防它破坏实时站点.

So the issue is something to do with the wp_users table but I don't know how to further diagnose or fix this. It works fine on the live server, but I'm afraid to upload my changes now in case it breaks the live site.

推荐答案

我通过删除wp_users和wp_usermeta表并将它们从实时服务器备份中导入来解决了这个问题.问题出在usermeta表上.

I solved the problem by deleting both the wp_users and wp_usermeta tables, and importing them from backups made from the live server. The problem was with the usermeta table.

这篇关于WordPress-我无法登录-wp_users表出了点问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆