ERROR 1115 (42000): Unknown character set: #39;utf8mb4#39;(错误 1115 (42000):未知字符集:utf8mb4)
问题描述
我有一个 MySQL 转储,我试图用它来恢复:
I have a MySQL dump, which I tried to restore with:
mysql -u"username" -p"password" --host="127.0.0.1" mysql_db < mysql_db
然而,这引发了一个错误:
However, this threw an error:
ERROR 1115 (42000) at line 3231: Unknown character set: 'utf8mb4'
这是第 3231-3233 行:
This is lines 3231-3233:
/*!50003 SET character_set_client = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection = utf8mb4_general_ci */ ;
我使用的是 MySQL 5.1.69.我该如何解决这个错误?
I am using MySQL 5.1.69. How can I solve this error?
推荐答案
您的版本不支持该字符集,我相信是 5.5.3 引入的.你应该将你的 mysql 升级到你用来导出这个文件的版本.
Your version does not support that character set, I believe it was 5.5.3 that introduced it. You should upgrade your mysql to the version you used to export this file.
错误很明显:您在代码中设置了某个字符集,但您的 mysql 版本不支持它,因此不知道它.
The error is then quite clear: you set a certain character set in your code, but your mysql version does not support it, and therefore does not know about it.
根据https://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html :
utf8mb4 是 utf8 的超集
utf8mb4 is a superset of utf8
所以也许你有机会把它变成 utf8,闭上眼睛并抱有希望,但这取决于你的数据,我不推荐它.
so maybe there is a chance you can just make it utf8, close your eyes and hope, but that would depend on your data, and I'd not recommend it.
这篇关于错误 1115 (42000):未知字符集:'utf8mb4'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:错误 1115 (42000):未知字符集:'utf8mb4'
基础教程推荐
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- 带更新的 sqlite CTE 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
