连接mysql数据库,执行以下sql语句
UPDATE wp_options SET option_value = replace(option_value, 'www.olddomain.com','www.newdomain.com') ;
UPDATE wp_posts SET post_content = replace(post_content, 'www.olddomain.com','www.newdomain.com') ;
UPDATE wp_comments SET comment_content = replace(comment_content, 'www.olddomain.com', 'www.newdomain.com') ;
UPDATE wp_comments SET comment_author_url = replace(comment_author_url, 'www.olddomain.com', 'www.newdomain.com') ;
UPDATE wp_posts SET guid = replace(guid, 'www.olddomain.com', 'www.newdomain.com');
UPDATE wp_blogs SET domain = replace(domain, 'www.olddomain.com', 'www.newdomain.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'www.olddomain.com', 'www.newdomain.com');
UPDATE wp_site SET domain = replace(domain, 'www.olddomain.com', 'www.newdomain.com');
UPDATE wp_usermeta SET meta_value = replace(meta_value, 'www.olddomain.com', 'www.newdomain.com');