错误1115(42000):未知字符集:'utf8mb4' [英] ERROR 1115 (42000): Unknown character set: 'utf8mb4'

查看:2656
本文介绍了错误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'


b $ b

这是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'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆