我的连接字符串具有以下属性:useUnicode=true&characterEncoding=utf8&character_set_server=utf8mb4&charset=utf8mb4。
我使用了:
我使用了:
jpaProperties.put("hibernate.connection.useUnicode", true);
jpaProperties.put("hibernate.connection.characterEncoding", "utf8");
jpaProperties.put("hibernate.connection.CharSet", "utf8mb4");
当我手动添加记录时,该数据库也支持utf8mb4,因为它可以正确保存。
但在尝试保存表情符号时仍然出现错误。
Incorrect string value: '\xF0\x9F\x98\x88\xF0\x9F...' for column 'name' at row 1