mysqlbinlog Options
You are viewing an old version of this article. View
the current version here.
The following options are supported by mysqlbinlog. They can be specified on
the command line or in the [client]
and
[mysqlbinlog]
option file groups.
short form | long form | default value | Description | Introduced |
---|---|---|---|---|
-? |
| Display a help statement. | ||
| (No Default Value) | Determine when the output statements should be base64-encoded BINLOG statements: 'never' disables it and works only for binlogs without row-based events; 'decode-rows' decodes row events into commented SQL statements if the option is also given; 'auto' prints base64 only when necessary (i.e., for row-based events and format description events); 'always' prints base64 whenever possible. 'always' is for debugging only and should not be used in a production system. If this argument is not given, the default is 'auto'; if it is given with no argument, 'always' is used. | MySQL 5.1.5 | |
| 4294967040 (4GB) | The maximum size in bytes of a row-based binary log event. Should be a multiple of 256. | MariaDB 10.1.17 | |
| (No default value) | Directory where character sets are. | ||
-d |
| (No default value) | List entries for just this database (local log only). | |
| FALSE | Check memory and open file usage at exit. | MySQL 5.1.21 | |
| FALSE | Print some debug info at exit. | MySQL 5.1.21 | |
-D |
| FALSE | Disable binary log. This is useful, if you enabled and are sending the output to the same MySQL 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. | |
-F |
| TRUE | Force if binlog was not closed properly. | |
-f |
| FALSE | Force reading unknown binlog events. | |
-H |
| FALSE | Augment output with hexadecimal and ASCII event dump. | MySQL 5.1.2 |
-h |
| (No default value) | Get the binlog from server. | |
-l |
| (No default value) | Prepare local temporary files for LOAD DATA INFILE in the specified directory. | |
-o |
| 0 | Skip the first N entries. | |
-p |
| (No default value) | Password to connect to remote server. | |
-P |
| 0 | 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). | |
| 4 | Deprecated. Use instead. | ||
| (No default value) | The protocol of the connection (tcp,socket,pipe,memory). | ||
-R |
| FALSE | Read binary logs from a MySQL server | |
-r |
| (No default value) | Direct output to a given file. | |
| 0 | Extract only binlog entries created by the server having the given id. | MySQL 5.1.4 | |
| (No default value) | Add 'SET NAMES character_set ' to the output. | MySQL 5.1.12 | |
-s |
| FALSE | Just show regular queries: no extra info and no row-based events. This is for testing only, and should not be used in production systems. If you want to suppress base64-output, consider using instead. | |
-S |
| (No default value) | Socket file to use for connection. | |
| (No default value) | 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 MySQL 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). | ||
-j |
| 4 | Start reading the binlog at position N. Applies to the first binlog passed on the command line. | |
| (No default value) | 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 MySQL 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). | ||
| 18446744073709551615 | Stop reading the binlog at position N. Applies to the last binlog passed on the command line. | ||
-t |
| FALSE | 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 MySQL server. If you send the output to the same MySQL server, that may lead to an endless loop. | |
-u |
| (No default value) | Connect to the remote server as username. | |
-v |
| Reconstruct SQL statements out of row events. -v -v adds comments on column data types | MySQL 5.1.28 | |
-V |
| Print version and exit. | ||
| 64 | Used to reserve file descriptors for usage by this program | ||
| (No default value) | Updates to a database with a different name than the original. Example: rewrite-db='from->to' For events that are binlogged as statements, rewriting the database constitutes changing a statement's default database from db1 to db2 .There is no statement analysis or rewrite of any kind, that is, if one specifies " db1.tbl " in the statement explicitly, that occurrence won't be changed to "db2.tbl ".Row-based events are rewritten correctly to use the new database name. Filtering (e.g. with ) happens after the database rewrites have been performed.If you use this option on the command line and " > " has a special meaning to your command interpreter, quote the value (e.g. ). | MariaDB 5.2.0 | |
| Skip all Annotate_rows events in the mysqlbinlog output (by default, mysqlbinlog prints Annotate_rows events, if the binary log does contain them). | MariaDB 5.3 | ||
| Verify binlog event checksums when reading a binlog file. | MariaDB 5.3 |
See Also
Comments
Comments loading...
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.