mysqlbinlog

mysqlbinlog

The mysqlbinlog utility displays the contents of a binary update log file in readable format. This program can read log files on the local host directly or connect to a remote server to read remote logs.

The format of binary update logs has changed from time to time. You may find it necessary to use a version of mysqlbinlog that is at least as recent as your server version to avoid compatibility problems.

Usage

mysqlbinlog [options] file_name ... 
 

Standard Options Supported by mysqlbinlog

--debug       --host        --port        --version 
--help        --password    --user
 

The --host, --password, --port, and --user options are used when you want to connect to a remote server to access its binary logs. Otherwise, mysqlbinlog reads local log files directly without connecting to a server.

Options Specific to mysqlbinlog

  • --database=db_name, -d db_name,

    Extract statements from the log file only for the named database. This option works only when reading local logs.

  • --offset=n, -o n

    Skip the first n entries in the log file.

  • --position=n, -j n

    Start reading the log file at position n.

  • --result-file=file_name, -r file_name

    Write output to the named file.

  • --short-form, -s

    Show only the statements in the log; omit any extra information in the log that is associated with the statements.

  • --table=tbl_name, -t tbl_name

    Obtain a raw dump of the named table.

mysqlbug

The MySQL Reference Manual contains a detailed procedure for filing a bug report. Following that procedure helps ensure that your report will be helpful and will contain sufficient information to resolve the problem you're reporting. A key part of this procedure is to use the mysqlbug script. It's used to create and send a bug report to the MySQL mailing list when you discover a problem with MySQL. mysqlbug gathers information about your system and MySQL configuration and then drops you into an editor containing the contents of the mail message to be sent. (mysqlbug attempts to determine what editor to use by examining the VISUAL and EDITOR environment variables. If neither variable is set, mysqlbug uses emacs.)

Edit the message to add as much information as you can about the problem you are reporting, and then write out the message to save your changes and exit the editor. mysqlbug will ask you whether to send the report and then mails it if you confirm.

Please use mysqlbug to report bugs, but don't use it lightly. In many cases, a "bug" isn't a bug at all or is a report of something that has already been documented in the MySQL Reference Manual. The MySQL mailing list archives are another useful source of information for checking whether behavior that you observe actually is erroneous. Links to the manual and to the archives can be found at http://www.mysql.com/documentation/.

mysqlbug is a shell script and does not run on Windows. If you use the WinMySQLAdmin or MySQLCC Windows applications, you can use their error-reporting facilities. Alternatively, the mysqlbug.txt file in the top directory of the MySQL distribution can be used as a template. Fill it in and email it to bugs@lists.mysql.com.

Usage

mysqlbug [address] 
 

The bug report is sent to the MySQL mailing list by default. If you specify an email address on the command line, the report is sent to that address instead. You can specify your own address to try out mysqlbug without sending the report to the mailing list; that's not a bad idea when you're first using the script and are perhaps not quite sure how it works.