WordPress 資料庫命令 新舊網域名稱替換教程

2021-10-22 08:58:51 字數 890 閱讀 5890

下面就是新舊網域名稱在資料庫中進行替換的內容了,我們以wp1.com作為老網域名稱,替換為新的wp2.com網域名稱為例進行講解。

1.1 登入你的**資料庫管理

把下面的wordpress新舊網域名稱替換命令複製到 sql 標籤頁的命令框中,如上圖所示,命令**如下:

update wp_options set option_value = replace(option_value, 'wp1.com', 'wp2.com') where option_name = 'home' or option_name = 'siteurl';

update wp_posts set post_content = replace(post_content, 'wp1.com', 'wp2.com');

update wp_postmeta set meta_value = replace(meta_value, 'wp1.com', 'wp2.com');

update wp_comments set comment_content = replace(comment_content , 'wp1.com', 'wp2.com');

其中的 wp_ 是你的資料庫表字首,根據自己安裝wordpress**時的自定義表字首可能會有不同。

wp_posts

wp_postmeta

wp_comments

wp_links(不推薦使用的**)

資料庫命令

mysql常用命令 show databases use manage create table user name varchar 20 password varchar 20 age int describe user insert into user values admin admin 10...

Mysql資料庫命令

create database mydata use mydata create table dept deptno int primary key,dname varchar 14 loc varchar 13 create table emp empno int primary key,enam...

oracle資料庫命令

oracle資料庫命令 1.資料庫啟動,登陸資料庫 sqlplus as sysdba 2.開啟資料庫 startup 3.建立表 create table team id int,name varchar 50 varchar 10 4.刪除表 drop table team 5.插入 inser...