

Btw thanks for figuring out that changing the config file fixed the problem while changing the value at runtime does not. However, upgrading ConnectorJ didn't solve anything. as utf8mb4 in the SET NAMES= calls it makes when establishing the connection. It used to be that the client character-set handshake from ConnectorJ used to use the regular/incomplete utf8 character set instead of utf8mb4Ĭonnector/J now auto-detects servers configured with character_set_server=utf8mb4 or treats the Java encoding utf-8 passed using characterEncoding=.
#Mysql connectorj update
When I manually set the value using SET GLOBAL ConnectorJ continues to use Latin1.ĭoes anybody know why this would be so? Is there any way to update the character set in a way that ConnectorJ will detect without having to take mysql offline? When I change the character_set_server value in the my.cnf and restart my server ConnectorJ detects the utf8mb4 exactly as it's supposed to. The server is currently running and so to update the character_set_server value I simply ran SET GLOBAL and SET statements.


The output of the SHOW VARIABLES call is as follows:

Sat Jul 06 15:45: INFO: Profiler Event: at (DriverManager.java:579) duration: 1 ms, connection-id: 57, statement-id: 999, resultset-id: 0, message: SET NAMES latin1 Sat Jul 06 15:45: INFO: Profiler Event: at (DriverManager.java:579) duration: 3 ms, connection-id: 57, statement-id: 4, resultset-id: 6 Sat Jul 06 15:45: INFO: Profiler Event: at (DriverManager.java:579) duration: 0 ms, connection-id: 57, statement-id: 4, resultset-id: 6, message: SHOW COLLATION Sat Jul 06 15:45: INFO: Profiler Event: at (DriverManager.java:579) duration: 0 ms, connection-id: 57, statement-id: 3, resultset-id: 5, message: /* mysql-connector-java-5.1.18 ( Revision: ) */SELECT Jul 06 15:45: INFO: Profiler Event: at (DriverManager.java:579) duration: 0 ms, connection-id: 57, statement-id: 3, resultset-id: 5 Sat Jul 06 15:45: INFO: Profiler Event: at (DriverManager.java:579) duration: 0 ms, connection-id: 57, statement-id: 3, resultset-id: 4 Sat Jul 06 15:45: INFO: Profiler Event: at (DriverManager.java:579) duration: 1 ms, connection-id: 57, statement-id: 3, resultset-id: 4, message: /* mysql-connector-java-5.1.18 ( Revision: ) */SHOW VARIABLES WHERE Variable_name ='language' OR Variable_name = 'net_write_timeout' OR Variable_name = 'interactive_timeout' OR Variable_name = 'wait_timeout' OR Variable_name = 'character_set_client' OR Variable_name = 'character_set_connection' OR Variable_name = 'character_set' OR Variable_name = 'character_set_server' OR Variable_name = 'tx_isolation' OR Variable_name = 'transaction_isolation' OR Variable_name = 'character_set_results' OR Variable_name = 'timezone' OR Variable_name = 'time_zone' OR Variable_name = 'system_time_zone' OR Variable_name = 'lower_case_table_names' OR Variable_name = 'max_allowed_packet' OR Variable_name = 'net_buffer_length' OR Variable_name = 'sql_mode' OR Variable_name = 'query_cache_type' OR Variable_name = 'query_cache_size' OR Variable_name = 'init_connect' Log output from the connector-j profiler: SET NAMES latin1 instead of SET NAMES utf8mb4 However, as best as I can tell it is always defaulting to We are using ConnectorJ 5.1.18.Īccording to the documentation ConnectorJ should autodetect the character encoding based upon the character_set_server variable. I am trying to properly store utf8mb4 strings into MySQL 5.5.30.
