How to Read MySQL Binary Log Files (BinLog) with mysqlbinlog MySQLのバイナリログファイルを読む方法について( binlogへ)をmysqlbinlogに

MySQL database server generates binary log files for every transaction to the databases, provided administrator does not disable or comment out the “log-bin” parameter in my.cny configuration file. MySQLデータベースサーバのログファイルを生成するバイナリのデータベースのすべてのトランザクションを、管理者に提供されませんを無効にするかをコメントアウトして"ログ-ビン"のパラメータにmy.cnyの設定ファイルです。 The binary log files are written in binary format.バイナリログファイルは、バイナリ形式で書かれています。 Although the binary logs, or also known as logbin are mainly used for MySQL database replication purpose, sometimes you may need to examine or read the contents of binary logs in text format, where the mysqlbinlog utility will come in handy.は、バイナリログか、またはとしても知られlogbin mysqlデータベースのレプリケーションは、主に使用される目的のために、時にはを検討する必要がありますまたはバイナリログの内容を読んでテキスト形式で、ここでは、 mysqlbinlogユーティリティは重宝する。

Binary log file, which normally has name with the format host_name-bin.xxxxxx and store in /var/lib/mysql directory, could not be opened and read straight away as it’s in unreadable binary format.バイナリログファイルは、通常の形式は、名前をhost_nameの- bin.xxxxxxとストアでに/ var / lib / mysqlディレクトリ、開くことができませんでしたを読んですぐに読み取れないのバイナリ形式です。 To read the binary logs in text format, we can make use of mysqlbinlog command, which also able to readrelay log files written by a slave server in a replication setup.バイナリログを読むにはテキスト形式で、私たちにmysqlbinlogコマンドも使用できるように、これもできるように書かれたreadrelayスレーブサーバのログファイルに、複製のセットアップを実行します。 Relay logs have the same format as binary log files.リレーログは、同じ形式のバイナリログファイルです。

To use mysqlbinlog utility is simple, simply use the following command syntax to invoke mysqlbinlog after login in as root (else you have to specify user name and password) to shell via SSH: mysqlbinlogユーティリティを使用するは、簡単で、単純には、以下のコマンドの構文を起動するには、 rootとしてログインした後にmysqlbinlog (他には、ユーザー名とパスワードを指定する)をssh経由でシェル:

mysqlbinlog [options] log_file … mysqlbinlogに[オプション] log_file …

So to read and display the contents of the binary log file named binlog.000001, use this command:これを読むと、バイナリログの内容を表示するにbinlog.000001という名前のファイルを使うと、このコマンド:

mysqlbinlog binlog.000001 mysqlbinlogにbinlog.000001

The binary log files and its data are likely to be very huge, thus making it almost impossible to read anything on screen.バイナリログファイルとそのデータが予想される非常に巨大な、このように何かを読むことがほとんど不可能を画面に表示する。 However, you can pipe the output of mysqlbinlog into a file which can be open up for later browsing in text editor, by using the following command:しかし、パイプの出力をすることができます。 mysqlbinlogにこれをファイルにブラウズできる開放へのテキストエディタを使用して、次のコマンド:

mysqlbinlog binlog.000001 > filename.txt mysqlbinlogにbinlog.000001 > filename.txtと

To reduce the amount of data retrieved from binary logs, there are several options that can be used to limit the data that is been returned.量を減らすには他の項目からのデータをバイナリログには、いくつかのオプションを制限するために使われることができるデータが返されています。 Among the useful ones are listed below:間の有用なものは次のとおりです:

–start-datetime=datetime スタート-日時=日時

Start reading the binary log at the first event having a timestamp equal to or later than the datetime argument.スタート]ボタンを読んでバイナリログの最初のイベントのタイムスタンプに等しい持つまたはそれ以降の引数日時よりです。 The datetime value is relative to the local time zone on the machine where you run mysqlbinlog. datetimeの値が相対的にされているマシンのローカルタイムゾーンにmysqlbinlogを実行する場所です。 The value should be in a format accepted for the DATETIME or TIMESTAMP data types.の値のフォーマットの受け入れを実施すべきであるが、日時やタイムスタンプのデータ型です。 For example:例えば:

mysqlbinlog --start-datetime="2005-12-25 11:25:56" binlog.000001 mysqlbinlogに-開始日時= " 2 005-12-251 1時2 5分5 6秒" b inlog.000001

–stop-datetime=datetime -停止-日時=日時

Stop reading the binary log at the first event having a timestamp equal or posterior to the datetime argument.読むのを止めて、バイナリログの最初のイベントで同額後のタイムスタンプを持つdatetimeアーギュメントです。 This option is useful for point-in-time recovery.このオプションは、お役にたちました- in - timeリカバリをポイントします。 See the description of the –start-datetime option for information about the datetime value.詳細については、説明書をスタート- datetimeオプションの詳細については、 datetime値です。

–start-position=N スタートポジション= n

Start reading the binary log at the first event having a position equal to the N argument.スタート]ボタンを読んでバイナリログの最初のイベントがある地位のnの引数に等しいです。 This option applies to the first log file named on the command line.このオプションが適用さ、最初のコマンドライン上でログファイルの名前です。

–stop-position=N 停止位置= n

Stop reading the binary log at the first event having a position equal or greater than the N argument.読むのを止めて、バイナリログの位置の最初のイベントに等しいかそれ以上のnの引数です。 This option applies to the last log file named on the command line.このオプションが適用さログファイルの最後のコマンドライン上で名づけています。

For more usage information on mysqlbinlog, visit mysqlbinlogには他の利用方法については、下記のをご覧 hereここで .です。

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要 :これは、機械翻訳ページで提供"現状有姿"を保証します。 Machine translation may be difficult to understand.機械翻訳を理解するのは難しいかもしれません。 Please refer toを参照してください original English articleオリジナルの英語記事索引 whenever possible.いつ可能です。

Share and contribute or get technical support and help atを共有して貢献や技術サポートとヘルプを得る My Digital Life Forums 私のデジタルライフフォーラム .です。



One Response to “How to Read MySQL Binary Log Files (BinLog) with mysqlbinlog” 1つの応答を" MySQLバイナリログファイルを読み取る方法( binlogへ)をmysqlbinlogに"

  1. Pisu pisu
    June 29th, 2008 16:33 2008年6月29日16:33
    1

    This post saved my life today… when the binary log were the only way to retrieve important data get lost… thanks!!この投稿を保存したときに私の人生の今日…バイナリログは、重要なデータを取得する唯一の方法で道に迷う…ありがとう! !

Leave a Reply残して返信

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> これらのタグを使用することができます: <aのhref=のtitle=のtitle= <abbr <acronymのtitle= <b>ダウンロード<blockquote cite=""> <cite>の<code> <デル日時= " " >の<em> <i>て<strike> <strong> <q cite="">

Subscribe without commenting登録なしのコメント


Custom Search

New Articles新しい記事

Incoming Search Terms for the Article検索用語を受信するには

mysqlbinlog mysqlbinlogに - - mysql logs MySQLのログ - - BINLOG binlogへ - - mysql binary log MySQLのバイナリログ - - mysql log file MySQLのログファイル - - mysql binlogs MySQLのbinlogs - - read mysql logs MySQLのログを読む - - mysql log files MySQLのログファイル - - mysql log reader MySQLのログリーダー - - mysql binary logs MySQLバイナリログ - - mysql binary log reader MySQLバイナリログリーダー - - mysql binlog MySQLのbinlogへ - - read mysql log MySQLのログを読む - - reading mysql logs 読書MySQLのログ - - mysql read bin log MySQLのログを読むビン - - mysql bin log MySQLのビンログ - - how to read mysql log MySQLのログを読む方法について - - mysql read log MySQLのログを読む - - mysql log read MySQLのログを読む - - mysql bin log reader MySQLのビンログリーダー - - binlog mysql binlogへのMySQL - - mysql binlog reader 読者のMySQL binlogへ - - mysql binlog format MySQLのbinlogへの形式 - - read mysql bin log MySQLのビンログを読む - - mysql binary log format MySQLバイナリログ形式 - - mysql binary logging MySQLのバイナリログ - - mysqlbinlog usage mysqlbinlogに利用方法 - - reading mysql bin logs 読書MySQLのビンログ - - mysql read transaction log MySQLのトランザクションログを読む - - mysql binary log files MySQLのバイナリログファイル - - how to read mysql logs MySQLのログに記録する方法を読む - - mysql binary MySQLバイナリ - - mysql log format MySQLのログ形式 - - mysqlbinlog example mysqlbinlogに例 - - binary log バイナリログ - - read binlog 読み取りbinlogへ - - read mysql binlog 読むのMySQL binlogへ - - binlogs mysql MySQLのbinlogs - - mysql-bin read MySQLのビンを読む - - mysql bin log export MySQLのビンログのエクスポート - - mysqlbinlog restore mysqlbinlogに復元 - - binlogs in mysql MySQLのbinlogs - - mysqlbinlog mysqlbinlogに - - how to read mysql log file MySQLのログファイルを読み取る方法 - - how to read mysql bin log MySQLのビンログを読み取る方法 - - how to read mysql binlog どのように読むのMySQL binlogへ - - mysqlbinlog windows mysqlbinlogにWindowsの - - mysql logging MySQLのログ - - mysql binary log location MySQLバイナリログの場所 - - mysql log files windows MySQLのログファイルのWindows - -