Mycat default Character set is UTF8
The following review logs verify the impact of different MySQL client character sets and the server character set on Mycat.
There are three main parts in the log that are related to the character set:
1. Initializing the MYCAT connection pool
2. Heartbeat detection
3. Synchronization of connections when executing SQL statements.
Because the MYCAT implementation of the three-node read-write separation and automatic switching, the following modifications are on the localhost node on the MySQL instance of the character set, the other two points (192.168.244.146 and 192.168.244.144) are not modified. Default is
Mysql>Show variables like 'character_set_%';+--------------------------+----------------------------+|Variable_name|Value|+--------------------------+----------------------------+|Character_set_client|Utf8||Character_set_connection|Utf8||Character_set_database|Latin1||Character_set_filesystem| binary ||Character_set_results|Utf8||Character_set_server|Latin1||Character_set_system|Utf8||Character_sets_dir| /Usr/Share/Mysql/Charsets/ |+--------------------------+----------------------------+8Rowsinch Set(0.01Sec
One, when the client character set (character_set_client) is UTF8, the service-side character set (Character_set_server) is latin1.
Mysql>Show variables like 'character_set_%';+--------------------------+----------------------------+|Variable_name|Value|+--------------------------+----------------------------+|Character_set_client|Utf8||Character_set_connection|Utf8||Character_set_database|Latin1||Character_set_filesystem| binary ||Character_set_results|Utf8||Character_set_server|Latin1||Character_set_system|Utf8||Character_sets_dir| /Usr/Share/Mysql/Charsets/ |+--------------------------+----------------------------+8Rowsinch Set(0.00Sec
The log output of Mycat is as follows:
1. Initializing the connection pool
2. Heartbeat detection
3. Synchronization of connections when executing SQL statements.
Second, when the client character set is latin1, the service-side character set is also latin1.
Mysql>Show variables like 'character_set_%';+--------------------------+----------------------------+|Variable_name|Value|+--------------------------+----------------------------+|Character_set_client|Latin1||Character_set_connection|Latin1||Character_set_database|Latin1||Character_set_filesystem| binary ||Character_set_results|Latin1||Character_set_server|Latin1||Character_set_system|Utf8||Character_sets_dir| /Usr/Share/Mysql/Charsets/ |+--------------------------+----------------------------+8Rowsinch Set(0.00Sec
The log output of Mycat is as follows:
1. Initializing the MYCAT connection pool
2. Heartbeat detection
3. Synchronization of connections when executing SQL statements.
Third, when the client character set is latin1, the service-side character set is also UTF8.
Mysql>Show variables like 'character_set_%';+--------------------------+----------------------------+|Variable_name|Value|+--------------------------+----------------------------+|Character_set_client|Latin1||Character_set_connection|Latin1||Character_set_database|Utf8||Character_set_filesystem| binary ||Character_set_results|Latin1||Character_set_server|Utf8||Character_set_system|Utf8||Character_sets_dir| /Usr/Share/Mysql/Charsets/ |+--------------------------+----------------------------+8Rowsinch Set(0.00Sec
The log output of Mycat is as follows:
1. Initializing the MYCAT connection pool
2. Heartbeat detection
3. Synchronization of connections when executing SQL statements.
Four, when the client character set is UTF8, the service-side character set is also UTF8.
Mysql>Show variables like 'character_set_%';+--------------------------+----------------------------+|Variable_name|Value|+--------------------------+----------------------------+|Character_set_client|Utf8||Character_set_connection|Utf8||Character_set_database|Utf8||Character_set_filesystem| binary ||Character_set_results|Utf8||Character_set_server|Utf8||Character_set_system|Utf8||Character_sets_dir| /Usr/Share/Mysql/Charsets/ |+--------------------------+----------------------------+8Rowsinch Set(0.00Sec
The log output of Mycat is as follows:
1. Initializing the MYCAT connection pool
2. Heartbeat detection
3. Synchronization of connections when executing SQL statements.
Summarize:
Initializes the Mycat connection pool, and the heartbeat detection character is related to the service-side character set, which is the value set by the Character_set_server. When the character set of the MySQL instance of localhost is changed to UTF8, Because the character set of the MySQL instance of the 192.168.244.146 and 192.168.244.144 two nodes does not change, the character set of localhost is UTF8 when heartbeat detection is performed, and the other two nodes are still latin1.
The synchronization connection is related to the client character set, which is the value set by Character_set_client.
About validation of the Mycat character set