wp更换域名替换老域名的sql查询替换法

| | Comments (0)



干净的替换掉老域名需要如下三条sql查询语句:

UPDATE wp_options SET option_value = replace(option_value,'old domain','new domain') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET post_content = replace(post_content,'old domain','new domain');

UPDATE wp_posts SET guid = replace(guid,'old domain','new domain');

domain格式 http://spoint.babyshoot.cn 最后不要带"/"

另外,直接拷贝以上三行执行sql语句时,别忘记确认下'单引号,可能拷贝下来的会出错,中文格式的单引号是不能正常执行的。。


以上三条是替换数据库中涉及的所有老域名。

Leave a comment

Archives

Ads by google

Pages

Powered by Movable Type 4.24-en

About this Entry

This page contains a single entry by 单点日志 published on March 20, 2010 12:52 AM.

心情很不好 was the previous entry in this blog.

欢迎您来到谷歌搜索在中国的新家 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.