今天将一个数据库导入到本地环境时,提示 #1273 – Unknown collation: ‘utf8mb4_unicode_520_ci’ 错误,具体如下图所示:

原因是数据库版本差异,导致wordpress数据库的编码整理方式不一样。MySQL 5.6 以及以上版本下,安装 WordPress 4.6 及以上版本的时候,默认的编码整理方式为 utf8mb4_unicode_520_ci,但是 MySQL 5.5 及以下版本的数据库,不支持 utf8mb4_unicode_520_ci,所以无法导入。
处理的办法,就是使用 sublime text 等代码编辑器,打开 .sql 数据库,然后批量查找替换所有的 utf8mb4_unicode_520_ci 为 utf8mb4_unicode_ci ,保存后上传即可。

来源:
https://www.wpdaxue.com/unknown-collation-utf8mb4_unicode_520_ci.html
微信公众号
手机浏览(小程序)
Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(): Failed to enable crypto in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_33658.jpg): failed to open stream: operation failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57