About validation of the Mycat character set

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.