diff options
Diffstat (limited to 'man/mysqlbinlog.1')
-rw-r--r-- | man/mysqlbinlog.1 | 264 |
1 files changed, 186 insertions, 78 deletions
diff --git a/man/mysqlbinlog.1 b/man/mysqlbinlog.1 index 5e9bc6c2f43..15c371a9913 100644 --- a/man/mysqlbinlog.1 +++ b/man/mysqlbinlog.1 @@ -1,13 +1,6 @@ '\" t -.\" Title: \fBmysqlbinlog\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/> -.\" Date: 04/06/2010 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.1 -.\" Language: English .\" -.TH "\FBMYSQLBINLOG\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System" +.TH "\FBMYSQLBINLOG\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -32,9 +25,7 @@ that describe modifications to database contents\&. The server writes these file \fBmysqlbinlog\fR utility\&. You can also use \fBmysqlbinlog\fR -to display the contents of relay log files written by a slave server in a replication setup because relay logs have the same format as binary logs\&. The binary log and relay log are discussed further in -Section\ \&5.2.4, \(lqThe Binary Log\(rq, and -Section\ \&16.2.2, \(lqReplication Relay and Status Files\(rq\&. +to display the contents of relay log files written by a slave server in a replication setup because relay logs have the same format as binary logs\&. .PP Invoke \fBmysqlbinlog\fR @@ -64,8 +55,7 @@ shell> \fBmysqlbinlog binlog\&.0000003\fR .\} .PP The output includes events contained in -binlog\&.000003\&. For statement\-based logging, event information includes the SQL statement, the ID of the server on which it was executed, the timestamp when the statement was executed, how much time it took, and so forth\&. For row\-based logging, the event indicates a row change rather than an SQL statement\&. See -Section\ \&16.1.2, \(lqReplication Formats\(rq, for information about logging modes\&. +binlog\&.000003\&. For statement\-based logging, event information includes the SQL statement, the ID of the server on which it was executed, the timestamp when the statement was executed, how much time it took, and so forth\&. For row\-based logging, the event indicates a row change rather than an SQL statement\&. .PP Events are preceded by header comments that provide additional information\&. For example: .sp @@ -102,12 +92,11 @@ indicates the result from executing the event\&. Zero means that no error occurr The output from \fBmysqlbinlog\fR can be re\-executed (for example, by using it as input to -\fBmysql\fR) to redo the statements in the log\&. This is useful for recovery operations after a server crash\&. For other usage examples, see the discussion later in this section and -Section\ \&6.5, \(lqPoint-in-Time (Incremental) Recovery Using the Binary Log\(rq\&. +\fBmysql\fR) to redo the statements in the log\&. This is useful for recovery operations after a server crash\&. For other usage examples, see the discussion later in this section\&. .PP Normally, you use \fBmysqlbinlog\fR -to read binary log files directly and apply them to the local MySQL server\&. It is also possible to read binary logs from a remote server by using the +to read binary log files directly and apply them to the local MariaDB server\&. It is also possible to read binary logs from a remote server by using the \fB\-\-read\-from\-remote\-server\fR option\&. To read remote binary logs, the connection parameter options can be given to indicate how to connect to the server\&. These options are \fB\-\-host\fR, @@ -125,9 +114,6 @@ supports the following options, which can be specified on the command line or in and [client] option file groups\&. -\fBmysqlbinlog\fR -also supports the options for processing option files described at -Section\ \&4.2.3.3.1, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .sp .RS 4 .ie n \{\ @@ -211,7 +197,7 @@ displays BINLOG statements whenever possible\&. This is the implied value if the option is given as \fB\-\-base64\-output\fR -without a value\&. +without a value\&. Both ALWAYS and not giving a value are deprecated. .RE .sp .RS 4 @@ -255,17 +241,14 @@ NEVER, it does not exit with an error if a row event is found\&. .RS 4 The \fB\-\-base64\-output\fR -option was introduced in MySQL 5\&.1\&.5, to be given as +can be given as \fB\-\-base64\-output\fR or \fB\-\-skip\-base64\-output\fR (with the sense of AUTO or -NEVER)\&. The option values described in the preceding list may be used as of MySQL 5\&.1\&.24, with the exception of -UNSPEC -and -DECODE\-ROWS, which are available as of MySQL 5\&.1\&.28\&. +NEVER)\&. .sp For examples that show the effect of \fB\-\-base64\-output\fR @@ -274,6 +257,22 @@ and on row event output, see the section called \(lqMYSQLBINLOG ROW EVENT DISPLAY\(rq\&. .RE +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlbinlog: binlog-row-event-max-size option +.\" binlog-row-event-max-size option: mysqlbinlog +\fB\-\-binlog\-row\-event\-max\-size\=\fR\fB\fIpath\fR\fR +.sp +The directory where character sets are installed\&. +.RE .sp .RS 4 .ie n \{\ @@ -287,8 +286,7 @@ the section called \(lqMYSQLBINLOG ROW EVENT DISPLAY\(rq\&. .\" character-sets-dir option: mysqlbinlog \fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR .sp -The directory where character sets are installed\&. See -Section\ \&9.5, \(lqCharacter Set Configuration\(rq\&. +The directory where character sets are installed\&. .RE .sp .RS 4 @@ -308,7 +306,7 @@ This option causes \fBmysqlbinlog\fR to output entries from the binary log (local log only) that occur while \fIdb_name\fR -is been selected as the default database by +has been selected as the default database by USE\&. .sp The @@ -452,10 +450,11 @@ USE\&. (In particular, no cross\-database updates should be used\&.) .br This option did not work correctly for \fBmysqlbinlog\fR -with row\-based logging prior to MySQL 5\&.1\&.37\&. (\m[blue]\fBBug#42941\fR\m[]\&\s-2\u[1]\d\s+2) +with row\-based logging prior to MySQL 5\&.1\&.37\&. .sp .5v .RE .RE +.RE .sp .RS 4 .ie n \{\ @@ -489,7 +488,7 @@ string is .\" debug-check option: mysqlbinlog \fB\-\-debug\-check\fR .sp -Print some debugging information when the program exits\&. This option was added in MySQL 5\&.1\&.21\&. +Print some debugging information when the program exits\&. .RE .sp .RS 4 @@ -504,7 +503,52 @@ Print some debugging information when the program exits\&. This option was added .\" debug-info option: mysqlbinlog \fB\-\-debug\-info\fR .sp -Print debugging information and memory and CPU usage statistics when the program exits\&. This option was added in MySQL 5\&.1\&.21\&. +Print debugging information and memory and CPU usage statistics when the program exits\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlbinlog: defaults-extra-file option +.\" defaults-extra-file option: mysqlbinlog +\fB\-\-defaults\-extra\-file=\fR\fB\fIname\fR +.sp +Read this file after the global files are read\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlbinlog: defaults-file option +.\" defaults-file option: mysqlbinlog +\fB\-\-defaults\-file=\fR\fB\fIname\fR +.sp +Only read default options from the given file\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlbinlog: default-auth option +.\" default-auth option: mysqlbinlog +\fB\-\-default\-auth=\fR\fB\fIname\fR +.sp +Default authentication client-side plugin to use\&. .RE .sp .RS 4 @@ -522,7 +566,7 @@ Print debugging information and memory and CPU usage statistics when the program .sp Disable binary logging\&. This is useful for avoiding an endless loop if you use the \fB\-\-to\-last\-log\fR -option and are sending the output to the same MySQL server\&. This option also is useful when restoring after a crash to avoid duplication of the statements you have logged\&. +option and are sending the output to the same MariaDB server\&. This option also is useful when restoring after a crash to avoid duplication of the statements you have logged\&. .sp This option requires that you have the SUPER @@ -545,6 +589,21 @@ privilege\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlbinlog: force-if-open option +.\" force-if-open option: mysqlbinlog +\fB\-\-force\-if\-open\fR +.sp +Force if binlog was not closed properly. Defaults to on; use \fB--skip-force-if-open\fR to disable\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlbinlog: force-read option .\" force-read option: mysqlbinlog \fB\-\-force\-read\fR, @@ -571,7 +630,7 @@ stops if it reads such an event\&. \fB\-H\fR .sp Display a hex dump of the log in comments, as described in -the section called \(lqMYSQLBINLOG HEX DUMP FORMAT\(rq\&. The hex output can be helpful for replication debugging\&. This option was added in MySQL 5\&.1\&.2\&. +the section called \(lqMYSQLBINLOG HEX DUMP FORMAT\(rq\&. The hex output can be helpful for replication debugging\&. .RE .sp .RS 4 @@ -587,7 +646,7 @@ the section called \(lqMYSQLBINLOG HEX DUMP FORMAT\(rq\&. The hex output can be \fB\-\-host=\fR\fB\fIhost_name\fR\fR, \fB\-h \fR\fB\fIhost_name\fR\fR .sp -Get the binary log from the MySQL server on the given host\&. +Get the binary log from the MariaDB server on the given host\&. .RE .sp .RS 4 @@ -616,6 +675,21 @@ in the specified directory\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlbinlog: no-defaults option +.\" no-defaults option: mysqlbinlog +\fB\-\-no\-defaults\fR +.sp +Don't read default options from any option file\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlbinlog: offset option .\" offset option: mysqlbinlog \fB\-\-offset=\fR\fB\fIN\fR\fR, @@ -651,8 +725,8 @@ option on the command line, \fBmysqlbinlog\fR prompts for one\&. .sp -Specifying a password on the command line should be considered insecure\&. See -Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&. +Specifying a password on the command line should be considered insecure\&. You +can use an option file to avoid giving the password on the command line\&. .RE .sp .RS 4 @@ -663,12 +737,11 @@ Section\ \&5.3.2.2, \(lqEnd-User Guidelines for Password Security\(rq\&. You can .sp -1 .IP \(bu 2.3 .\} -.\" mysqlbinlog: port option -.\" port option: mysqlbinlog -\fB\-\-port=\fR\fB\fIport_num\fR\fR, -\fB\-P \fR\fB\fIport_num\fR\fR +.\" mysqlbinlog: plugin-dir option +.\" plugin-dir option: mysqlbinlog +\fB\-\-plugin\-dir=\fIdir_name\fR .sp -The TCP/IP port number to use for connecting to a remote server\&. +Directory for client-side plugins\&. .RE .sp .RS 4 @@ -679,15 +752,29 @@ The TCP/IP port number to use for connecting to a remote server\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysqlbinlog: position option -.\" position option: mysqlbinlog -\fB\-\-position=\fR\fB\fIN\fR\fR +.\" mysqlbinlog: print-defaults option +.\" print-defaults option: mysqlbinlog +\fB\-\-print\-defaults\fR .sp -Deprecated\&. Use -\fB\-\-start\-position\fR -instead\&. -\fB\-\-position\fR -is removed in MySQL 5\&.5\&. +Print the program argument list from all option files and exit\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlbinlog: port option +.\" port option: mysqlbinlog +\fB\-\-port=\fR\fB\fIport_num\fR\fR, +\fB\-P \fR\fB\fIport_num\fR\fR +.sp +The TCP/IP port number to use for connecting to a remote server, +or \fB0\fR for default to, in order of preference, \fBmy.cnf\fR, +\fB$MYSQL_TCP_PORT\fR, \fB/etc/services\fR, \fRbuilt-in default (3306)\fR\&. .RE .sp .RS 4 @@ -702,8 +789,7 @@ is removed in MySQL 5\&.5\&. .\" protocol option: mysqlbinlog \fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR .sp -The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the allowable values, see -Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&. +The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. .RE .sp .RS 4 @@ -735,7 +821,7 @@ Sets the open_files_limit variable, which is used to reserve file descriptors fo \fB\-\-read\-from\-remote\-server\fR, \fB\-R\fR .sp -Read the binary log from a MySQL server rather than reading a local log file\&. Any connection parameter options are ignored unless this option is given as well\&. These options are +Read the binary log from a MariaDB server rather than reading a local log file\&. Any connection parameter options are ignored unless this option is given as well\&. These options are \fB\-\-host\fR, \fB\-\-password\fR, \fB\-\-port\fR, @@ -770,11 +856,37 @@ Direct output to the given file\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlbinlog: rewrite-db option +.\" rewrite-db option: mysqlbinlog +\fB\-\-rewrite\-db=\fR\fB\fIname\fR\fR, +\fB\-r \fR\fB\fIname\fR\fR +.sp +Updates to a database with a different name than the original. +Example: \fBrewrite-db='from->to'\fR\&. For events that are +binlogged as statements, rewriting the database constitutes changing a +statement's default database from \fIdb1\fB to \fIdb2\fR\&. There is no statement +analysis or rewrite of any kind, that is, if one specifies \fB"db1.tbl"\fR +in the statement explicitly, that occurrence won't be changed to +\fB"db2.tbl"\fR\&. Row-based events are rewritten correctly to use the new +database name\&. Filtering (e.g. with \fB--database=name\fR) happens after +the database rewrites have been performed\&. If you use this option on the +command line and \fB">"\fR has a special meaning to your command interpreter, +quote the value (e.g. \fB--rewrite-db="oldname->newname"\fR\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlbinlog: server-id option .\" server-id option: mysqlbinlog \fB\-\-server\-id=\fR\fB\fIid\fR\fR .sp -Display only those events created by the server having the given server ID\&. This option is available as of MySQL 5\&.1\&.4\&. +Display only those events created by the server having the given server ID\&. .RE .sp .RS 4 @@ -791,7 +903,7 @@ Display only those events created by the server having the given server ID\&. Th .sp Add a SET NAMES \fIcharset_name\fR -statement to the output to specify the character set to be used for processing log files\&. This option was added in MySQL 5\&.1\&.12\&. +statement to the output to specify the character set to be used for processing log files\&. .RE .sp .RS 4 @@ -807,7 +919,10 @@ statement to the output to specify the character set to be used for processing l \fB\-\-short\-form\fR, \fB\-s\fR .sp -Display only the statements contained in the log, without any extra information\&. +Display only the statements contained in the log, 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 \fB--base64-output=never\fR instead\&. .RE .sp .RS 4 @@ -854,14 +969,13 @@ data types\&. For example: .RS 4 .\} .nf -shell> \fBmysqlbinlog \-\-start\-datetime="2005\-12\-25 11:25:56" binlog\&.000003\fR +shell> \fBmysqlbinlog \-\-start\-datetime="2014\-12\-25 11:25:56" binlog\&.000003\fR .fi .if n \{\ .RE .\} .sp -This option is useful for point\-in\-time recovery\&. See -Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&. +This option is useful for point\-in\-time recovery\&. .RE .sp .RS 4 @@ -880,8 +994,7 @@ Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&. Start reading the binary log at the first event having a position equal to or greater than \fIN\fR\&. This option applies to the first log file named on the command line\&. .sp -This option is useful for point\-in\-time recovery\&. See -Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&. +This option is useful for point\-in\-time recovery\&. .RE .sp .RS 4 @@ -904,8 +1017,7 @@ option for information about the \fIdatetime\fR value\&. .sp -This option is useful for point\-in\-time recovery\&. See -Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&. +This option is useful for point\-in\-time recovery\&. .RE .sp .RS 4 @@ -923,8 +1035,7 @@ Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&. Stop reading the binary log at the first event having a position equal to or greater than \fIN\fR\&. This option applies to the last log file named on the command line\&. .sp -This option is useful for point\-in\-time recovery\&. See -Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&. +This option is useful for point\-in\-time recovery\&. .RE .sp .RS 4 @@ -940,7 +1051,7 @@ Section\ \&6.3, \(lqExample Backup and Recovery Strategy\(rq\&. \fB\-\-to\-last\-log\fR, \fB\-t\fR .sp -Do not stop at the end of the requested binary log from a MySQL server, but rather continue printing until the end of the last binary log\&. If you send the output to the same MySQL server, this may lead to an endless loop\&. This option requires +Do not stop at the end of the requested binary log from a MariaDB server, but rather continue printing until the end of the last binary log\&. If you send the output to the same MariaDB server, this may lead to an endless loop, so this option requires \fB\-\-read\-from\-remote\-server\fR\&. .RE .sp @@ -957,7 +1068,7 @@ Do not stop at the end of the requested binary log from a MySQL server, but rath \fB\-\-user=\fR\fB\fIuser_name\fR\fR, \fB\-u \fR\fB\fIuser_name\fR\fR .sp -The MySQL user name to use when connecting to a remote server\&. +The MariaDB username to use when connecting to a remote server\&. .RE .sp .RS 4 @@ -973,7 +1084,7 @@ The MySQL user name to use when connecting to a remote server\&. \fB\-\-verbose\fR, \fB\-v\fR .sp -Reconstruct row events and display them as commented SQL statements\&. If this option is given twice, the output includes comments to indicate column data types and some metadata\&. This option was added in MySQL 5\&.1\&.28\&. +Reconstruct row events and display them as commented SQL statements\&. If this option is given twice, the output includes comments to indicate column data types and some metadata\&. .sp For examples that show the effect of \fB\-\-base64\-output\fR @@ -1021,8 +1132,8 @@ You can pipe the output of \fBmysqlbinlog\fR into the \fBmysql\fR -client to execute the events contained in the binary log\&. This technique is used to recover from a crash when you have an old backup (see -Section\ \&6.5, \(lqPoint-in-Time (Incremental) Recovery Using the Binary Log\(rq)\&. For example: +client to execute the events contained in the binary log\&. This technique is used to recover from a crash when you have an old +backup\&. For example: .sp .if n \{\ .RS 4 @@ -1073,7 +1184,7 @@ option, it displays only those events with an offset in the binary log greater t option (to be able to say, for example, \(lqroll forward my databases to how they were today at 10:30 a\&.m\&.\(rq)\&. .PP -If you have more than one binary log to execute on the MySQL server, the safe method is to process them all using a single connection to the server\&. Here is an example that demonstrates what may be +If you have more than one binary log to execute on the MariaDB server, the safe method is to process them all using a single connection to the server\&. Here is an example that demonstrates what may be \fIunsafe\fR: .sp .if n \{\ @@ -1145,8 +1256,7 @@ LOAD DATA LOCAL INFILE statements (that is, it adds LOCAL), both the client and the server that you use to process the statements must be configured with the LOCAL -capability enabled\&. See -Section\ \&5.3.5, \(lqSecurity Issues with LOAD DATA LOCAL\(rq\&. +capability enabled\&. .if n \{\ .sp .\} @@ -1591,7 +1701,7 @@ type codes\&. The \fB\-\-base64\-output=DECODE\-ROWS\fR and \fB\-\-verbose\fR -options may be used to affect row event output\&. These options are available as of MySQL 5\&.1\&.28\&. +options may be used to affect row event output\&. .PP Suppose that the server is using row\-based binary logging and that you execute the following sequence of statements: .sp @@ -1952,7 +2062,7 @@ option can be used to prevent this header from being written\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -1967,8 +2077,6 @@ Bug#42941 \%http://bugs.mysql.com/bug.php?id=42941 .RE .SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. +For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR -Sun Microsystems, Inc. (http://www.mysql.com/). +MariaDB Foundation (http://www.mariadb.org/). |