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. This fix makes the function generate, as per the JDBC API specification, a list of the latest MySQL and SQL standard keywords that are not also SQL92 (or, depending on the JDBC version in use, SQL2003) keywords.I am trying to properly store utf8mb4 strings into MySQL 5.5.30. DatabaseMetaData.getKeywords() did not return the latest reserved words as found in MySQL Server's documentation (for example, in Reserved Words).If non-standard character sets or collations might be used, users should set detectCustomCollations=true. The introduction of this new property with the default value of false alters the old default behaviour of calling ConnectionImpl.buildCollationMapping() at each connection. When its value is false (which is the default value), the ConnectionImpl.buildCollationMapping() method, for detecting non-standard character sets or collations, will NOT be called during the instantiation of a connection, thus shortening the time for establishing a connection. Added a new connection property detectCustomCollations=.