mysqlbinlog [options] filename

This utility formats the display of the binary log for a MySQL server. Customized applications can also use it for monitoring server activities. The path to the log file to format is given as the second argument for the utility. Additional log files may be given either with filesystem wildcards or by listing them individually, separated by spaces.

Here is an alphabetical list of the options, along with a brief explanation of each:


This option is used to write binary log entries using base-64 encoding. This is used for debugging and should not be used in production. It’s available as of version 5.1.5 of MySQL.


This option specifies the directory containing character sets.

--database=database, -d database

This option displays information regarding only the database given.

--debug[=options], -# [options]

This option logs debugging information, along with various settings (e.g., 'd:t:o,logname').


This option writes debugging information to the log when the utility ends. It’s available as of version 5.1.21 of MySQL.


This option writes debugging information and CPU and memory usage information to the log after the utility ends.

--disable-log-bin, -D

This option disables binary logging.

--force-read, -f

This option forces the reading of unknown log information.

--hexdump, -H

This option dumps the log in hexadecimal format.

--help, -?

This option displays basic help information.

--host= ...

Get MySQL in a Nutshell, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.