简体   繁体   中英

IncorrectString with mariadb and not with mysql5.5

A java application using payara (glassfish) try to save the body of an email into a column into db (with eclipslink) We have the same application onto 2 different server,that differ for dbserver: the first one is with mariadb 10.1.26 (java 1.8.0_131), the second one with mysql 5.5.57 (java 1.8.0_144) The same mail from the first server throws

Local Exception Stack: 
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.3.qualifier): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect string value: '\xEF\xBF\xBD1 h...' for column 'msg_body' at row 1

What is really strange for me is that with the second server the import goes flowless, no warning, body saved

We have already checked the configuration of the two server, and seems to be both equal The foloowing are exactly the same onto the 2 databases:

-All the table are with character_set_name latin1

-the variable collation are

collation_connection = utf8mb4_unicode_ci

collation_database = utf8mb4_general_ci

collation_server = utf8mb4_general_ci

As said, the two database have exactly the same conf. Do anybody have idea why one server is working and the other no?

我们进行了大量测试,似乎差异在于数据库服务器的全局变量,具有mariadb的计算机具有utf8mb4_general_ci,而mysql具有latin1_swedish_ci更改了mariadb服务器“似乎”的值已解决了问题

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM