惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
PCI Perspectives
PCI Perspectives
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V2EX - 技术
V2EX - 技术
Google DeepMind News
Google DeepMind News
量子位
博客园_首页
S
SegmentFault 最新的问题
S
Secure Thoughts
F
Full Disclosure
H
Hacker News: Front Page
博客园 - 三生石上(FineUI控件)
U
Unit 42
H
Heimdal Security Blog
N
News and Events Feed by Topic
A
About on SuperTechFans
C
CERT Recently Published Vulnerability Notes
Cyberwarzone
Cyberwarzone
Help Net Security
Help Net Security
The Hacker News
The Hacker News
L
LINUX DO - 最新话题
Application and Cybersecurity Blog
Application and Cybersecurity Blog
罗磊的独立博客
N
News | PayPal Newsroom
Spread Privacy
Spread Privacy
C
Cisco Blogs
C
CXSECURITY Database RSS Feed - CXSecurity.com
云风的 BLOG
云风的 BLOG
A
Arctic Wolf
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Simon Willison's Weblog
Simon Willison's Weblog
B
Blog
人人都是产品经理
人人都是产品经理
TaoSecurity Blog
TaoSecurity Blog
博客园 - 【当耐特】
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
I
InfoQ
D
DataBreaches.Net
大猫的无限游戏
大猫的无限游戏
Apple Machine Learning Research
Apple Machine Learning Research
L
LINUX DO - 热门话题
Google Online Security Blog
Google Online Security Blog
V
Visual Studio Blog
V
Vulnerabilities – Threatpost
Know Your Adversary
Know Your Adversary
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
B
Blog RSS Feed

记录生活,精彩一刻 - 数据库

宝塔面板强制安装 MySQL8.0 Typecho 数据库字符集导致Emoji表情评论报错 Typecho更换新域名教程 数据库篇
Typecho 网站更换域名操作指南
Huo · 2024-05-29 · via 记录生活,精彩一刻 - 数据库

Typecho logo

1、通用网站域名更换方法

  1. 域名解析,把新网站域名解析到网站 IP 上
  2. 修改 web 服务器配置文件,如 nginx.conf 、.htaccess、以及配置 SSL 证书等
  3. 修改站点配置和网站内容

2、Typecho 网站域名更换

Typecho 网站的域名更换方法和上面的基本一致,在第三点上可能有一些通过数据库操作的便捷方法。

对于网站配置和网站内容的修改,一种办法是进入到网站后台,挨个进行修改,只是这种方法太过于麻烦和耗时,另一种简易的办法是通过数据库直接进行修改,非常便捷,有遗漏的手动进行查漏补缺即可。

以下 SQL 语句默认表前缀为 typecho_,若你的数据库表前缀不是 typecho_,请自行修改语句。

2.1 修改 typecho\_options 表

将网站的设置里的域名替换成新的域名:

UPDATE `typecho_options` SET `value` = '新域名地址' WHERE `typecho_options`.`name` = 'siteUrl' AND `typecho_options`.`user` =0;

2.2 修改 typecho\_contents 表

将网站文章里的旧域名替换成新的域名:

UPDATE `typecho_contents` SET `text` = REPLACE(`text`,'旧域名地址','新域名地址');

2.3 修改 typecho\_users 表

将管理员的个人网站进行替换:

UPDATE `typecho_users` SET `url` = REPLACE(`url`,'旧域名地址','新域名地址');

2.4 修改 typecho\_comments 表

对评论中的管理员的域名,和评论中的旧域名进行替换:

UPDATE `typecho_comments` SET `url` = REPLACE(`url`,'旧域名地址','新域名地址');

UPDATE `typecho_comments` SET `text` = REPLACE(`text`,'旧域名地址','新域名地址');

如果使用的域名邮箱,也建议进行更换:

UPDATE `typecho_comments` SET `mail` = REPLACE(`mail`,'旧域名地址','新域名地址');

2.5 查漏补缺

如果还有其他的地方修改,参照上面的 SQL 语句进行替换即可,也可以进入网站后台手动进行修改~