简体   繁体   中英

mysql connectorJ character set results does not support utf8mb4

I m having a tomcat server having a connection pool to mysql.

In the connection settings i can see all the character set encodings set to utf8mb4 in *this page except for character_set_results.

My connection string being -

 jdbc:mysql://:3306/abc?character_set_server=utf8mb4&useOldAliasMetadataBehavior=true&character_set_connection=utf8mb4&characterEncoding=utf-8&character_set_results=utf8mb4

In the mysql server i can see character_set_results showing utf8mb4.

But in the jsp page it is not shown anyway.

The mysql version is 5.6.16 and connector version is 5.1.22

Regards

connection settings need not characterEncoding and character_set_server, mysql connectorJ will auto check.

make sure character_set_database=utf8mb4,character_set_server=utf8mb4, Table character set=utf8mb4, some columns use varchar character set=utf8mb4;

tip: character_set_server=utf8mb4 need config my.ini Exemple:

[mysql]
default-character-set = utf8mb4

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
init_connect='SET NAMES utf8mb4'

loose-default-character-set = utf8mb4
[client]
default-character-set = utf8mb4
loose-default-character-set = utf8mb4

https://dev.mysql.com/doc/refman/5.6/en/charset-unicode-utf8mb4.html?spm=5176.2020520165.110.53.AlPmXp

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