解决wordpress密码正确后台登录不上

登录wordpress后台,密码正确,但是登录不上。网上找了一些方法:

修改文件“/wp-includes/pluggable.php”中的wp_set_auth_cookie函数。搜索此行代码(代码较长,分为两行):

1setcookie($auth_cookie_name,$auth_cookie,$expire,
2ADMIN_COOKIE_PATH,COOKIE_DOMAIN,$secure,true);

  将上面代码中的 ADMIN_COOKIE_PATH 改为 SITECOOKIEPATH ,当然,你会搜出两行,博主测试的结果是修改第一行就可以了,完整修改如下:

1setcookie($auth_cookie_name,$auth_cookie,$expire,
2SITECOOKIEPATH,COOKIE_DOMAIN,$secure,true);

发现还是登录不了。清缓存,换浏览器,重启php和mysql后,还是登录不上。

用df -h 看磁盘空间,发现也还没满。

用网上方法, 登录后直接访问WordPress站点地址(URL)/wp-admin/index.php ,发现也是登录不上。

然后想起最近装了一些插件,把插件改文件名称,也是无效。最后看到看日志,查了mysql的错误日志,发现下面日志:

InnoDB: mysqld and edit my.cnf so that newraw is replaced
InnoDB: with raw, and innodb_force_... is removed.
InnoDB: A new raw disk partition was initialized or
InnoDB: innodb_force_recovery is on: we do not allow
InnoDB: database modifications by the user. Shut down
InnoDB: mysqld and edit my.cnf so that newraw is replaced
InnoDB: with raw, and innodb_force_... is removed.

想到最近mysql崩溃了,在my.cnf的innodb_force_recovery的值被我强制改成1后恢复了,想回不会是这个影响,把
innodb_force_recovery 的值又改为0。重启mysql后登录wordpress,果然正常了。

总结:网上的方法并不是简单照搬就能解决问题,要分析最近操作了什么,看日志,对症下药。

关注公众号“大模型全栈程序员”回复“小程序”获取1000个小程序打包源码。更多免费资源在http://www.gitweixin.com/?p=2627

发表评论

邮箱地址不会被公开。 必填项已用*标注