How to Read MySQL Binary Log Files (BinLog) with mysqlbinlog Cara Membaca MySQL Binary Log Files (BinLog) dengan 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. Database MySQL biner menghasilkan file-file log untuk setiap transaksi ke database, asalkan administrator tidak menonaktifkan atau komentar yang "log-bin" parameter di file konfigurasi my.cny. The binary log files are written in binary format. File log biner ditulis dalam format biner. 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. Meskipun log biner, atau juga dikenal sebagai logbin dipakai terutama untuk tujuan replikasi database MySQL, kadang-kadang anda mungkin perlu memeriksa atau membaca isi dari log biner dalam format teks, di mana utilitas mysqlbinlog akan berguna.

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. Binary file log, yang biasanya memiliki nama dengan format host_name-bin.xxxxxx dan simpan di / var / lib / mysql direktori, tidak bisa dibuka dan dibaca langsung seperti itu dalam format binari dibaca. 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. Untuk membaca log biner dalam format teks, kita dapat menggunakan perintah mysqlbinlog, yang juga mampu readrelay file-file log yang ditulis oleh seorang budak replikasi server di setup. Relay logs have the same format as binary log files. Relay log memiliki format yang sama dengan file-file log biner.

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: Untuk menggunakan utilitas mysqlbinlog sederhana, cukup gunakan perintah berikut sintaks untuk memohon mysqlbinlog setelah login sebagai root (lain Anda harus menentukan nama pengguna dan password) untuk shell melalui SSH:

mysqlbinlog [options] log_file ...

So to read and display the contents of the binary log file named binlog.000001, use this command: Jadi untuk membaca dan menampilkan isi file log biner bernama binlog.000001, gunakan perintah ini:

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. Binary file log dan data cenderung sangat besar, sehingga membuat hampir tidak mungkin untuk membaca apa-apa di layar. 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: Namun, Anda dapat pipa output dari mysqlbinlog ke sebuah file yang dapat membuka diri untuk nanti browsing di editor teks, dengan menggunakan perintah berikut:

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. Untuk mengurangi jumlah data yang diambil dari log biner, ada beberapa pilihan yang dapat digunakan untuk membatasi data yang dikembalikan. Among the useful ones are listed below: Di antara yang berguna tercantum di bawah ini:

–start-datetime=datetime -Start-datetime = datetime

Start reading the binary log at the first event having a timestamp equal to or later than the datetime argument. Mulailah membaca log biner pada peristiwa pertama memiliki timestamp sama dengan atau lebih lambat dari argumen datetime. The datetime value is relative to the local time zone on the machine where you run mysqlbinlog. Nilai yang datetime relatif terhadap zona waktu lokal di mesin di mana Anda menjalankan mysqlbinlog. The value should be in a format accepted for the DATETIME or TIMESTAMP data types. Nilai harus dalam format yang diterima untuk DATETIME atau TIMESTAMP tipe data. For example: Contoh:

mysqlbinlog --start-datetime="2005-12-25 11:25:56" binlog.000001

–stop-datetime=datetime -Stop-datetime = datetime

Stop reading the binary log at the first event having a timestamp equal or posterior to the datetime argument. Berhenti membaca log biner pada peristiwa pertama memiliki timestamp sama atau posterior ke datetime argumen. This option is useful for point-in-time recovery. Pilihan ini berguna untuk titik-in-time pemulihan. See the description of the –start-datetime option for information about the datetime value. Lihat deskripsi-start-datetime opsi untuk informasi tentang nilai datetime.

–start-position=N -Start-position = N

Start reading the binary log at the first event having a position equal to the N argument. Mulailah membaca log biner pada peristiwa pertama memiliki posisi N sama dengan argumen. This option applies to the first log file named on the command line. Pilihan ini berlaku untuk file log yang pertama bernama pada baris perintah.

–stop-position=N -Stop-posisi = N

Stop reading the binary log at the first event having a position equal or greater than the N argument. Berhenti membaca log biner pada peristiwa pertama memiliki posisi yang sama atau lebih besar dari N argumen. This option applies to the last log file named on the command line. Pilihan ini berlaku untuk nama file log terakhir pada baris perintah.

For more usage information on mysqlbinlog, visit Untuk informasi lebih lanjut tentang penggunaan mysqlbinlog, kunjungi here di sini . .

IMPORTANT : The page is machine translated and provided "as is" without warranty. PENTING: Halaman ini adalah mesin diterjemahkan dan diberikan "sebagaimana adanya" tanpa jaminan. Machine translation may be difficult to understand. Terjemahan mesin mungkin sulit untuk mengerti. Please refer to Silakan merujuk ke original English article artikel asli bahasa Inggris whenever possible. bila memungkinkan.


2 Responses to “How to Read MySQL Binary Log Files (BinLog) with mysqlbinlog” 2 Responses to "Cara Membaca MySQL Binary Log Files (BinLog) dengan mysqlbinlog"

  1. nicolas nicolas
    September 5th, 2009 05:04 5 September 2009 05:04
    2 2

    don't forget (as i did) to execute mysqlbinlog with a user that has permission to read the binlog or sudo works nicely too. jangan lupa (seperti yang saya lakukan) untuk melaksanakan mysqlbinlog dengan pengguna yang memiliki izin untuk membaca binlog atau sudo bekerja dengan baik juga.

  2. Pisu Pisu
    June 29th, 2008 16:33 29 Juni 2008 16:33
    1 1

    This post saved my life today… when the binary log were the only way to retrieve important data get lost… thanks!! Posting ini menyelamatkan hidupku hari ini ... ketika log biner adalah satu-satunya cara untuk mengambil data penting hilang ... thanks!!

Leave a Reply 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> Anda dapat menggunakan tag ini: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. Berlangganan ke fitur komentar telah dinonaktifkan. To receive notification of latest comments posted, subscribe to Untuk menerima pemberitahuan dari komentar terbaru diposting, untuk berlangganan My Digital Life Comments RSS feed My Digital Life Komentar RSS feed or atau register to receive mendaftar untuk menerima new comments in daily email digest. komentar baru di email digest harian.
Custom Search

New Articles Artikel Baru

Incoming Search Terms for the Article Cari Syarat masuk untuk Artikel

mysql binary log biner mysql log - -- mysqlbinlog command mysqlbinlog perintah - -- mysqlbinlog mysqlbinlog - -- binlog mysql binlog mysql - -- mysql bin log reader mysql bin pembaca log - -- reader mysql binary log biner mysql pembaca log - -- reading mysql-bin logs membaca mysql-bin log - -- view mysql binary log melihat log biner mysql - -- view mysql bin-log view mysql bin-log - -- windows mysqlbinlog jendela mysqlbinlog - -- BINLOG BINLOG - -- mysql binary log view tampilan log biner mysql - -- mysql transaction log view mysql transaksi tampilan log - -- binlog database upgrade upgrade database binlog - -- how to read binary text bagaimana membaca teks biner - -- how to read from mysql cara membaca dari mysql - -- how to read mysql binary logs cara membaca log biner mysql - -- log mysql-bin log mysql-bin - -- mysql read bin logs mysql bin membaca log - -- mysqlbinlog ubuntu examples contoh ubuntu mysqlbinlog - -- mysql reading transaction log mysql membaca log transaksi - -- mysql bin logs mysql bin log - -- MySQL+reading binary logs MySQL + membaca log biner - -- mysql search binary log cari mysql log biner - -- mysql read bin log file mysql bin membaca file log - -- mysql binlog programming interface mysql antarmuka pemrograman binlog - -- mysql bin log viewer mysql bin penampil log - -- mysqlbinlog howto mysqlbinlog howto - -- mysql binlogs mysql binlogs - -- mysql binlog viewer binlog mysql penampil - -- mysqlbinlog usage mysqlbinlog penggunaan - -- mysqlbinlog error relay log relay mysqlbinlog error log - -- mysql log viewer mysql penampil log - -- mysql-bin analyze mysql-bin menganalisis - -- MySQLBinlog.java+samples MySQLBinlog.java + sampel - -- read mysql bin log to a file mysql bin membaca log ke file - -- read mysql binary log membaca log biner mysql - -- view mysql log view mysql log - -- viewing mysql binary logs melihat log biner mysql - -- binlogs howto binlogs howto - -- examine mysql-bin memeriksa mysql-bin - -- hot to read mysql error log panas untuk membaca mysql error log yang - -- How would you get a listing of all binary log files? Bagaimana Anda akan mendapatkan daftar semua file-file log biner? - -- how to read binlog bagaimana membaca binlog - -- how to read mysql query log bagaimana membaca mysql query log - -- how to read from msql bagaimana membaca dari mSQL - -- mssql read bin file MSSQL membaca file bin - -- mysql logfile command mysql perintah logfile - -- mysql-bin files mysql-bin file - -- mysql binary log viewer biner mysql penampil log - --