1,501   WordPress

1,修改数据库配置,在wp-config.php文件

/** MySQL database username */
define('DB_USER', 'root');

/** MySQL database password */
define('DB_PASSWORD', '123456');

/** MySQL hostname */
define('DB_HOST', 'localhost');

2,如果更新了域名,则把旧域名修改

UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com',
'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com',
'http://www.new-domain.com');
UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-
domain.com');



2 Responses

Leave a Reply

Your email address will not be published. Required fields are marked *