执行mysqlbinlog 命令是遇到的异常。
[shuohai.lhl@v035114 ~]$ mysqlbinlog --host 10.249.193.105 -P3401 -R -u ****** -p****** mysql-bin.000019 -j 4 --base64-output=decode-rows --verbose > 1 mysqlbinlog: Character set '#45' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file mysqlbinlog: Character set '#45' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file mysqlbinlog: Character set '#45' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file mysqlbinlog: Character set '#45' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file mysqlbinlog: Character set '#45' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file mysqlbinlog: Character set '#45' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file
引用 http://dinglin.iteye.com/blog/1675824 如果是master-slave情况下,slave会卡住。如果是mysqlbinlog工具,只会打印信息说解析失败,还会继续即系其他的内容。
现象: 从库上Slave_IO_Running停止,Last_Error显示如下: bin/mysqlbinlog: Character set ‘#45′ is not a compiled character set and is not specified in the ‘/u01/dingqi.lxb/transfer2/master/share/mysql/charsets/Index.xml’ file
mysqlbinlog: Character set '#45' is not a compiled character set
and is not specified in the '/usr/share/mysql/charsets/Index.xml' file后面的文件,看下发现机器上不存在这个叫做Index.xml的文件,所以怀疑是异常信息不规范,或者应该查的是别的文件,到底是哪个文件呢???
继续,查看本机的mysql版本和mysqlbinlog版本,确实是低版本dump了高版本的mysql。
[shuohai.lhl@v035114 ~]$ mysql -V mysql Ver 14.14 Distrib 5.1.57, for unknown-linux-gnu (x86_64) using readline 5.1 [shuohai.lhl@v035114 ~]$ mysqlbinlog -V mysqlbinlog Ver 3.3 for unknown-linux-gnu at x86_64
[admin@v125051019 ~]$ mysqlbinlog --host 10.249.193.105 -P3401 -R -u ****** -p****** mysql-bin.000019 -j 4 --base64-output=decode-rows --verbose > 1
为什么呢,查看下mysql版本和mysqlbinlog的版本。
[admin@v125051019 ~]$ mysql -V mysql Ver 14.14 Distrib 5.5.17, for Linux (x86_64) using readline 5.1 [admin@v125051019 ~]$ mysqlbinlog -V mysqlbinlog Ver 3.3 for Linux at x86_64这台机器的msyql是5.5.17,再看下server的版本是5.5.18
[admin@v125051019 ~]$ mysql --host 10.249.193. -P3401 -u ****** -p****** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 11239893 Server version: 5.5.18.1-tb4373-log Source distribution没有打印异常日志,好奇看下那个Index.xml长什么模样~~~
原文太长,截个片段吧
<charset name="ascii"> <family>Western</family> <description>US ASCII</description> <alias>us</alias> <alias>us-ascii</alias> <alias>csascii</alias> <alias>iso-ir-6</alias> <alias>iso646-us</alias> <collation name="ascii_general_ci" id="11" order="English" flag="primary"/> <collation name="ascii_bin" id="65" order="Binary" flag="binary"/> </charset>
也许id=45被的character是在编译的时候生成的吧,亦或者是存在于其他文件中,欲知详情,只能源码了~~~
还有在第一台机器上没有找到指定这个Index.xml文件,也只能分析源码才能得到答案了吧
come on and on
查看解析出来的文件,确实发现了语句和45相关
# at 4
#140514 11:05:24 server id 3195034185 end_log_pos 107 Start: binlog v 4, server v 5.5.18.1-tb4373-log created 140514 11:05:24
# at 107
#140514 11:05:24 server id 3195034185 end_log_pos 180 Query thread_id=9429419 exec_time=0 error_code=0
SET TIMESTAMP=1400036724/*!*/;
SET @@session.pseudo_thread_id=9429419/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=2097152/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
SET @@session.character_set_client=45,@@session.collation_connection=45,@@session.collation_server=33/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
# at 180
# at 319
mysql> set @@session.character_set_client=45; Query OK, 0 rows affected (0.00 sec) mysql> show variables like "%character_set_client%" ; +----------------------+---------+ | Variable_name | Value | +----------------------+---------+ | character_set_client | utf8mb4 | +----------------------+---------+ 1 row in set (0.00 sec) mysql>