折腾:
【已解决】更换WordPress网站的域名从之前xxx换到xxx.it
期间,主页可以打开了。
但是资源没加载:

调试看到:都是旧域名
所以感觉是sql数据库的问题
后记:果然证明是:
mysql的sql文件中,图片等资源地址都是写死的,所以是旧的域名
需要去批量更新为新域名:
去导出数据库:


导出后,去查看和修改

xxx有1061个
xxx 有 1143个
先去替换:xxx
再看:
xxx
看了下,都是普通的邮箱等内容

可以直接替换
另外,再去把数据库名字改掉
从
xxx
改为
xxx_it

然后再去:
【已解决】PhpMyAdmin中新建mysql数据库并导入sql文件
然后再去同步修改wp-config.php中的配置:
wp-config.php
1 2 3 4 5 6 | /** WordPress数据库的名称 */ define( 'DB_NAME' , 'xxx_it' ); /** MySQL数据库用户名 */ define( 'DB_USER' , 'xxx_it' ); |
先删除在线的:
1 | rm -f wp-config.php |
再上传上去:
1 2 3 4 5 6 | [root@VM_0_10_centos www.xxx.it] # rz rz waiting to receive. Starting zmodem transfer. Press Ctrl+C to cancel. Transferring wp-config.php... Transferring wp-config.php, errors 1... 100% 3 KB 3 KB/sec 00:00:01 2 Errors |
重启一下php-fpm
1 2 3 | [root@VM_0_10_centos www.xxx.it] # service php-fpm restart Gracefully shutting down php-fpm . done Starting php-fpm done |
然后:
【已解决】WordPress网站更新wp-config.php后报错:Error establishing a database connection
再去:
【已解决】已解决数据库问题后WordPress中图片资源仍不能正常加载