Verification of the MyCAT Character Set

Source: Internet
Author: User

Verification of the MyCAT Character Set

The default Character Set of MyCAT is UTF8.

The following describes how to check the log to verify the effect of different MySQL client character sets and server character sets on MyCAT.

There are three main parts of logs related to character sets:

1. initialize the MyCAT connection pool

2. Heartbeat Detection

3. Connection synchronization during SQL statement execution.

Because MyCAT implements read/write splitting and automatic failover for three nodes, the following changes are the character set of the MySQL instance on the localhost node, and the other two points (192.168.244.146 and 192.168.244.144) are not modified. Default Value:

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/ |+--------------------------+----------------------------+8 rows in set (0.01 sec) 

1. When the character set of the client (character_set_client) is utf8, the character set of the server (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/ |+--------------------------+----------------------------+8 rows in set (0.00 sec)

MyCAT log output is as follows:

1. initialize the connection pool

2. Heartbeat Detection

3. Connection synchronization during SQL statement execution.

2. When the client character set is latin1, the server 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/ |+--------------------------+----------------------------+8 rows in set (0.00 sec)

MyCAT log output is as follows:

1. initialize the MyCAT connection pool

2. Heartbeat Detection

3. Connection synchronization during SQL statement execution.

3. When the client character set is latin1, the server 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/ |+--------------------------+----------------------------+8 rows in set (0.00 sec)

MyCAT log output is as follows:

1. initialize the MyCAT connection pool

2. Heartbeat Detection

3. Connection synchronization during SQL statement execution.

4. When the client character set is utf8, the server 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/ |+--------------------------+----------------------------+8 rows in set (0.00 sec)

MyCAT log output is as follows:

1. initialize the MyCAT connection pool

2. Heartbeat Detection

3. Connection synchronization during SQL statement execution.

Summary:

Initialize the MyCAT connection pool. The heartbeat detection characters are related to the server character set, that is, the value set by 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 on the 192.168.244.146 and 192.168.244.144 nodes does not change, during heartbeat detection, the character set of localhost is utf8, the other two nodes are still latin1.

The synchronous connection is related to the character set of the client, that is, the value set by character_set_client.

This article permanently updates the link address:

Related Article

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.