wordpress管理后台密码遗忘及无法登陆故障处理

wordpress管理后台密码遗忘,及无法登陆故障处理。
1、密码遗忘,登陆数据库,命令行操作;

[root@wp wp]# echo "admin" > wp.txt
[root@wp wp]# md5sum wp.txt 
f133332363f67f25e1c8a87b80e64a16  wp.txt
[root@wp wp]# rm -rf wp.txt 

[root@wp wp]# /usr/local/mysql/bin/mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 25532
Server version: 5.5.9-log Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use wpwp;                                                                         Database changed
mysql> update wp_users set user_pass = MD5('f133332363f67f25e1c8a87b80e64a16') where wp_users.user_login = "admin";
Query OK, 1 row affected (0.04 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> quit

2、后台无法登陆,一般由于更改了设置里面常规项的url地址导致,如下将www.mygod.com修复回www.mygod.cn

mysql> use wpwp;
Database changed

mysql> SELECT * FROM `wp_options` WHERE `option_name` IN ('siteurl','home') LIMIT 0,10;  
+-----------+---------+-------------+----------------------------+----------+
| option_id | blog_id | option_name | option_value               | autoload |
+-----------+---------+-------------+----------------------------+----------+
|        39 |       0 | home        | http://www.mygod.com/ | yes      |
|         3 |       0 | siteurl     | http://www.mygod.com/ | yes      |
+-----------+---------+-------------+----------------------------+----------+
2 rows in set (0.00 sec)

mysql> update wp_options set option_value='http://www.mygod.cn' where option_id = '39'; 
Query OK, 1 row affected (0.04 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> SELECT * FROM `wp_options` WHERE `option_name` IN ('siteurl','home') LIMIT 0,10;
+-----------+---------+-------------+----------------------------+----------+
| option_id | blog_id | option_name | option_value               | autoload |
+-----------+---------+-------------+----------------------------+----------+
|        39 |       0 | home        | http://www.mygod.cn       | yes      |
|         3 |       0 | siteurl     | http://www.mygod.com | yes      |
+-----------+---------+-------------+----------------------------+----------+
2 rows in set (0.00 sec)

mysql> update wp_options set option_value='http://www.mygod.cn' where option_id = '3';
Query OK, 1 row affected (0.03 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> SELECT * FROM `wp_options` WHERE `option_name` IN ('siteurl','home') LIMIT 0,10;
+-----------+---------+-------------+----------------------+----------+
+-----------+---------+-------------+----------------------+----------+
| option_id | blog_id | option_name | option_value         | autoload |
+-----------+---------+-------------+----------------------+----------+
|        39 |       0 | home        | http://www.mygod.cn | yes      |
|         3 |       0 | siteurl     | http://www.mygod.cn | yes      |
+-----------+---------+-------------+----------------------+----------+
2 rows in set (0.00 sec)

mysql> quit

2 Replies to “wordpress管理后台密码遗忘及无法登陆故障处理”

发表评论

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