至于MyCAT字符集的认证

MyCAT私下认可字符集是UTF8

下边通过翻看日志来验证不一样的MySQL客商端字符集和服务器字符集对于MyCAT的熏陶。

日志中与字符集有关的严重性有三部分:

  1. 初始化MyCAT连接池

  2. 心跳检验

  3. 在施行SQL语句时的延续同步。

因为MyCAT达成的是三节点的读写抽离和电动切换,以下校订的均是localhost节点上MySQL实例的字符集,其它四个点(192.168.244.146和192.168.244.144)均未有改造。默以为

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)

 

生龙活虎、当客商端字符集(character_set_client)为utf8,服务端字符集(character_set_server)为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的日记输出如下:

  1. 开首化连接池

图片 1

  1. 心跳检查实验

图片 2

3. 在施行SQL语句时的接连几日同步。

图片 3

 

二、当客商端字符集为latin1,服务端字符集也为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的日记输出如下:

  1. 初始化MyCAT连接池

图片 4

  1. 心跳检验

图片 5

  1. 在实行SQL语句时的连接同步。

图片 6

 

三、当客商端字符集为latin1,服务端字符集也为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的日记输出如下:

  1. 初始化MyCAT连接池

图片 7

  1. 心跳质量评定

图片 8

3.
在举行SQL语句时的接连几日同步。图片 9

 

四、当顾客端字符集为utf8,服务端字符集也为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的日志输出如下:

  1. 初始化MyCAT连接池

图片 10

  1. 心跳检验

图片 11

  1. 在试行SQL语句时的连接同步。

图片 12

 

总结:

早先化MyCAT连接池,心跳检查评定的字符与服务端字符集有关,即character_set_server设定的值。当localhost的MySQL实例的字符集改成utf8后,因为192.168.244.146和192.168.244.144五个节点的MySQL实例的字符集并未产生变化,所以举办心跳检测时,localhost的字符集为utf8,其余七个节点仍然是latin1。

一路三番五次与客商端字符集有关,即character_set_client设定的值。

 

网站地图xml地图