1 操作
运行mariadb monitor:
mysql
选择wordpress的数据库(按实际数据库名替换斜体字部分):
MariaDB [(none)]> use wpadmin;
把博客文章里的http://caibaoz.com替换成https://caibaoz.com(按实际域名替换斜体字部分):
MariaDB [wpadmin]> UPDATE wp_posts SET `post_content` = REPLACE (`post_content`, 'src="http://caibaoz.com', 'src="https://caibaoz.com');
如果网站具有多个站点,需要针对每个站点都运行一次类似命令(把wp_2_posts中的“2”替换为实际的站点ID):
MariaDB [wpadmin]> UPDATE wp_2_posts SET `post_content` = REPLACE (`post_content`, 'src="http://caibaoz.com', 'src="https://caibaoz.com');
2 参考文档
2.1 Replacing Image Links in WordPress After Installing an SSL Certificate
2.2 Error 1046 Mariadb: No database selected
Visits: 583