使用root进入mysql后台执行,xx.xxx.xxx.xx:800表示原地址,xx.xxx.xxx.xx表示新地址
mysql> UPDATE wp_options SET option_value = replace(option_value, 'xx.xxx.xxx.xx:800','xx.xxx.xxx.xx'); Query OK, 3 rows affected (0.13 sec) Rows matched: 160 Changed: 3 Warnings: 0 mysql> UPDATE wp_posts SET post_content = replace(post_content, 'xx.xxx.xxx.xx:800','xx.xxx.xxx.xx'); Query OK, 267 rows affected (0.13 sec) Rows matched: 457 Changed: 267 Warnings: 0 mysql> UPDATE wp_comments SET comment_content = replace(comment_content, 'xx.xxx.xxx.xx:800','xx.xxx.xxx.xx'); Query OK, 0 rows affected (0.00 sec) Rows matched: 0 Changed: 0 Warnings: 0 mysql> UPDATE wp_comments SET comment_author_url = replace(comment_author_url, 'xx.xxx.xxx.xx:800','xx.xxx.xxx.xx'); Query OK, 0 rows affected (0.00 sec) Rows matched: 0 Changed: 0 Warnings: 0