修改 wordpress URL

刚刚手贱,设置-常规 里修改了 WordPress地址(URL),结果WP就悲剧地坏了 (〒︿〒)

搜了一下,要在 mysql 数据库改回 URL

登录数据库:

user@server:~$ mysql -u root -p 你的wordpress数据库名
Enter password:

查询数据表 :

mysql> show tables;
+-----------------------------+
| Tables_in_wordpress         |
+-----------------------------+
| wp_commentmeta              |
| wp_comments                 |
| wp_links                    |
| wp_options                  |
| wp_postmeta                 |
| wp_posts                    |
| wp_term_relationships       |
| wp_term_taxonomy            |
| wp_terms                    |
| wp_usermeta                 |
| wp_users                    |
| wp_wc_comments_subscription |
| wp_wc_phrases               |
| wp_wc_users_voted           |
| wp_wfBadLeechers            |
| wp_wfBlockedIPLog           |
| wp_wfBlocks                 |
| wp_wfBlocksAdv              |
| wp_wfConfig                 |
| wp_wfCrawlers               |
| wp_wfFileMods               |
| wp_wfHits                   |
| wp_wfHoover                 |
| wp_wfIssues                 |
| wp_wfLeechers               |
| wp_wfLockedOut              |
| wp_wfLocs                   |
| wp_wfLogins                 |
| wp_wfNet404s                |
| wp_wfReverseCache           |
| wp_wfScanners               |
| wp_wfStatus                 |
| wp_wfThrottleLog            |
| wp_wfVulnScanners           |
+-----------------------------+
34 rows in set (0.00 sec)

mysql> select * from wp_options where option_name = 'siteurl';
+-----------+-------------+-----------------------+----------+
| option_id | option_name | option_value          | autoload |
+-----------+-------------+-----------------------+----------+
|         1 | siteurl     | http://blog.alalin.tk | yes      |
+-----------+-------------+-----------------------+----------+
1 row in set (0.00 sec)

WordPress地址(URL)就是上面这条了。

修改为正确的 URL:

mysql>  update wp_options set option_value = 'http://www.domain.com' where option_name = 'siteurl';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

到此,我的 wordpress 终于又复活了

如果还要修改 站点地址(URL):

mysql> select * from wp_options where option_name = 'home';
+-----------+-------------+-----------------------+----------+
| option_id | option_name | option_value | autoload |
+-----------+-------------+-----------------------+----------+
| 2 | home | http://mail.alalin.tk | yes |
+-----------+-------------+-----------------------+----------+
1 row in set (0.00 sec)

修改为正确的 URL:

mysql>  update wp_options set option_value = 'http://www.domain.com' where option_name = 'home';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

 

发表评论

电子邮件可用于接收评论通知,但不会被公开。必填项已用 * 标注。