Options for mariadb-binlog & mysqlbinlog in MariaDB Enterprise Server 10.5

Overview

The mariadb-binlog utility is the newer name for mysqlbinlog, though you can still run it using either name.

Option

Description

--base64-output

Determine when the output statements should be base64-encoded BINLOG statements: 'never' doesn't print binlog row events and should not be used when directing output to a MariaDB master; 'decode-rows' decodes row events into commented SQL statements if the --verbose option is also given; 'auto' prints base64 only when necessary (i.e., for row-based events and format description events); If no --base64-output=name option is given at all, the default is 'auto'.

--binlog-row-event-max-size

The maximum size of a row-based binary log event in bytes. Rows will be grouped into events smaller than this size if possible. This value must be a multiple of 256.

--character-sets-dir

Directory for character set files.

--database (-d)

List entries for just this database (local log only).

--debug-check

Check memory and open file usage at exit .

--debug-info

Print some debug info at exit.

--default-auth

Default authentication client-side plugin to use.

--defaults-extra-file

Read this file after the global files are read.

--defaults-file

Only read default options from the given file #.

--defaults-group-suffix

Additionally read default groups with # appended as a suffix.

--disable-log-bin (-D)

Disable binary log. This is useful, if you enabled --to-last-log and are sending the output to the same MariaDB server. This way you could avoid an endless loop. You would also like to use it when restoring after a crash to avoid duplication of the statements you already have. NOTE: you will need a SUPER privilege to use this option.

--flashback (-B)

Flashback feature can rollback you committed data to a special time point.

--force-if-open (-F)

Force if binlog was not closed properly. (Defaults to on; use --skip-force-if-open to disable.)

--force-read (-f)

Force reading unknown binlog events.

--help (-?)

Display this help and exit.

--hexdump (-H)

Augment output with hexadecimal and ASCII event dump.

--host (-h)

Get the binlog from server.

--local-load (-l)

Prepare local temporary files for LOAD DATA INFILE in the specified directory.

--no-defaults

Don't read default options from any option file.

--offset (-o)

Skip the first N entries.

--open-files-limit

Used to reserve file descriptors for use by this program.

--password (-p)

Password to connect to remote server.

--plugin-dir

Directory for client-side plugins.

--port (-P)

Port number to use for connection or 0 for default to, in order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306).

--print-defaults

Print the program argument list and exit.

--print-row-count

Print row counts for each row events (Defaults to on; use --skip-print-row-count to disable.)

--print-row-event-positions

Print row event positions (Defaults to on; use --skip-print-row-event-positions to disable.)

--print-table-metadata

Print metadata stored in Table_map_log_event

--protocol

The protocol to use for connection (tcp, socket, pipe).

--raw

Requires -R. Output raw binlog data instead of SQL statements. Output files named after server logs.

--read-from-remote-server (-R)

Read binary logs from a MariaDB server.

--result-file (-r)

Direct output to a given file. With --raw this is a prefix for the file names.

--rewrite-db

Updates to a database with a different name than the original. Example: rewrite-db='from->to'.

--server-id

Extract only binlog entries created by the server having the given id.

--set-charset

Add 'SET NAMES character_set' to the output.

--short-form (-s)

Just show regular queries: no extra info, no row-based events and no row counts. This is mainly for testing only, and should not be used to feed to the MariaDB server. If you want to just suppress base64-output, you can instead use --base64-output=never

--skip-annotate-row-events

Don't print Annotate_rows events stored in the binary log.

--socket (-S)

The socket file to use for connection.

--ssl

Enable SSL for connection (automatically enabled with other flags).

--ssl-ca

CA file in PEM format (check OpenSSL docs, implies --ssl).

--ssl-capath

CA directory (check OpenSSL docs, implies --ssl).

--ssl-cert

X509 cert in PEM format (implies --ssl).

--ssl-cipher

SSL cipher to use (implies --ssl).

--ssl-crl

Certificate revocation list (implies --ssl).

--ssl-crlpath

Certificate revocation list path (implies --ssl).

--ssl-key

X509 key in PEM format (implies --ssl).

--ssl-verify-server-cert

Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default.

--start-datetime

Start reading the binlog at first event having a datetime equal or posterior to the argument; the argument must be a date and time in the local time zone, in any format accepted by the MariaDB server for DATETIME and TIMESTAMP types, for example: 2004-12-25 11:25:56 (you should probably use quotes for your shell to set it properly).

--start-position (-j)

Start reading the binlog at position N. Applies to the first binlog passed on the command line.

--stop-datetime

Stop reading the binlog at first event having a datetime equal or posterior to the argument; the argument must be a date and time in the local time zone, in any format accepted by the MariaDB server for DATETIME and TIMESTAMP types, for example: 2004-12-25 11:25:56 (you should probably use quotes for your shell to set it properly).

--stop-never

Wait for more data from the server instead of stopping at the end of the last log. Implies --to-last-log.

--stop-never-slave-server-id

The slave server_id used for --read-from-remote-server --stop-never.

--stop-position

Stop reading the binlog at position N. Applies to the last binlog passed on the command line.

--table (-T)

List entries for just this table (local log only).

--tls-version

TLS protocol version for secure connection.

--to-last-log (-t)

Requires -R. Will not stop at the end of the requested binlog but rather continue printing until the end of the last binlog of the MariaDB server. If you send the output to the same MariaDB server, that may lead to an endless loop.

--user (-u)

Connect to the remote server as username.

--verbose (-v)

Reconstruct SQL statements out of row events. -v -v adds comments on column data types.

--verify-binlog-checksum (-c)

Verify binlog event checksums.

--version (-V)

Print version and exit.