Unknown collation: 'utf8mb4_unicode_ci'

日前给一个政府机关做个小的门户网站,用的是wordpress+主题开发,部署时发现导入数据库sql文本时出现Unknown collation: 'utf8mb4_unicode_ci'的错误,查了下原因:

I had the same issue as all of our servers run older versions of MySQL. This can be solved by running a PHP script. Save this code to a file and run it entering the database name, user and password and it'll change the collation from utf8mb4/utf8mb4_unicode_ci to utf8/utf8_general_ci

原因就是MySql的版本太老了,解决方法就是把 utf8mb4/utf8mb4_unicode_ci 替换成 utf8/utf8_general_ci

MySql版本不够,相信php的版本也没会够,三条黑线|||

参考资料

http://stackoverflow.com/questions/29916610/1273-unknown-collation-utf8mb4-unicode-ci-cpanel

原文地址:https://www.cnblogs.com/flowerszhong/p/5344074.html