日期:2017-07-09 阅读:1665
dmandwp系统 - wordpress系统和DM系统区块建站>>
小鸟云空间: https://www.niaoyun.com/host/
------------------
wordpress迁移主要是这下面几个工作:
1、上传文件和导入数据库
2、数据库配置: wp-config.php
3、表options的两个值的修改 siteurl 和 home改成域名的值
4、把后台的设置-->固定链接重新提交下。
具体请看视频教程。
----------------------------
导入数据库时:
错误提示: Unknown collation: 'utf8mb4_unicode_520_ci' -- 这是因为空间的数据库不支持utf8mb4_unicode_520_ci,
所以要转成utf8_general_ci
参考如下:
https://stackoverflow.com/questions/29916610/1273-unknown-collation-utf8mb4-unicode-ci-cpanel
简单点就是:
<h1>Convert your Database to utf8_general_ci!</h1>
<form action="db-convert.php" method="post">
dbname: <input type="text" name="dbname"><br>
dbuser: <input type="text" name="dbuser"><br>
dbpass: <input type="text" name="dbpassword"><br>
<input type="submit">
</form>
<?php
if ($_POST) {
$dbname = $_POST['dbname'];
$dbuser = $_POST['dbuser'];
$dbpassword = $_POST['dbpassword'];
$con = mysql_connect('localhost',$dbuser,$dbpassword);
if(!$con) { echo "Cannot connect to the database ";die();}
mysql_select_db($dbname);
$result=mysql_query('show tables');
while($tables = mysql_fetch_array($result)) {
foreach ($tables as $key => $value) {
mysql_query("ALTER TABLE $value CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci");
}}
echo "<script>alert('The collation of your database has been successfully changed!');</script>";
}
?>
如果错误提示utf8mb4_unicode_520_ci,说明有些地方还没有改干净,则用编辑器打开sql文件,
找到 CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci
把utf8mb4 换成utf8 ,把utf8mb4_unicode_520_ci换成utf8_general_ci