Some projects are currently migrated to Mysql5.5, and in mysql5.5 Binlog_format is mixed, the default MySQL binary log is base64 format, unreadable, in order to troubleshoot problems, Provide help reading under Mysqlbinlog's help document learned that it can be decoded:
–base64-output[=name]
Determine when the output statements should is
base64-encoded binlog: ' Never ' disables it and
works a for binlogs without row-based events;
' decode-rows ' decodes row events int o commented SQL
statements If The–verbose option is also given; ' Auto '
prints base64 only if necessary (i.e., for row-based
Events and Format description events); ' Always ' prints
base64 whenever possible. ' Always ' is deprecated, would be
removed in a future version, and should not to used in a
production system. –base64-output with no ' name '
argument be equivalent to–base64-output=always and is
also deprecated. If no –base64-output[=name] option is
given in all, and the default is ' auto '.
Mysqlbinlog–base64-output=decode-rows-v Mys ql-bin.00002
The binary log in row mode can be decoded with the given –base64-output and-v parameters.
Unknown variable ' default-character-set=utf8mb4′ error
A mobile phone network project, using the code for UTF8MB4, everything is normal.
When the Mysqlbinlog is used, the prompts are as follows:
[Root@localhost data]# Mysqlbinlog mysql-bin-500.000011
Mysqlbinlog:unknown variable ' default-character-set=utf8mb4′
Workaround:
1. Modify MY.CNF, annotate or delete default-character-set=utf8mb4 under [client];
2. Add the –no-defaults switch to the command line and use the mysqlbinlog–no-defaults;