How to Read MySQL Binary Log Files (BinLog) with mysqlbinlog Kā lasīt MySQL Binary Log faili (BinLog) ar 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 datu bāzes servera rada bināro log failus par katru darījumu ar datu bāzēm, ja administrators nav izslēgt vai komentārus no "log-bin" parametrs my.cny konfigurācijas failā. The binary log files are written in binary format. Bināro log faili tiek rakstīti binārā formātā. 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. Kaut bināro apaļkokus, vai arī pazīstams kā logbin galvenokārt izmanto MySQL datubāzi replikācijas mērķi, dažkārt Jums var būt nepieciešams pārbaudīt, vai lasīt divkāršo apaļkoku teksta formātā, satura kur mysqlbinlog lietderība noderēs.

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. Bināro log failu, kas parasti ir vārda formāts host_name-bin.xxxxxx un uzglabāt in / var / lib / mysql direktoriju nevarēja atvērt un nolasīt uzreiz, kā tas ir nesalasamībai binārā formātā. 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. Lasīt binārā apaļkoku teksta formātā, mēs varam izmantot mysqlbinlog komandu, kas arī var readrelay log failus raksta vergu servera replikācija setup. Relay logs have the same format as binary log files. Relay baļķi ir tādā pašā formātā kā bināro log failus.

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: Lai izmantotu mysqlbinlog lietderība ir vienkārša, vienkārši izmantojiet šādu komandu sintaksi atsaukties mysqlbinlog pēc autorizēties tik saknes (vēl jums ir jānorāda lietotājvārds un parole), lai apvalks caur SSH:

mysqlbinlog [options] log_file ...

So to read and display the contents of the binary log file named binlog.000001, use this command: Tad, lai lasīt un parādīt uz bināro log saturs Fails binlog.000001, izmantojiet šo komandu:

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. Bināro log failus un tās datiem var būt ļoti liels, tādējādi ir gandrīz neiespējami izlasīt kaut ko uz ekrāna. 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: Tomēr jūs varat caurules izejas mysqlbinlog stājas fails, kuru var atvērt, lai vēlāk pārlūkošanai teksta redaktoru, izmantojot komandu:

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. Lai samazinātu datu apjomu, kas iegūti no binārā baļķi, pastāv vairākas iespējas, ko var izmantot, lai ierobežotu datus, kas tiek nosūtīti atpakaļ. Among the useful ones are listed below: Starp noderīgs tiem ir minēti zemāk:

–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. Noklausītos bināro log ir pirmais pasākums, kuru laikspiedolu vienāds vai vēlāk par datetime arguments. The datetime value is relative to the local time zone on the machine where you run mysqlbinlog. Datetime vērtība ir attiecināta pret vietējo laika joslu mašīna kur jūs darbināt mysqlbinlog. The value should be in a format accepted for the DATETIME or TIMESTAMP data types. Vērtībai jābūt formātā, kas pieņemti DateTime vai Laikspiedols datu tipiem. For example: For example:

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. Jāpārtrauc lasīt bināro log ir pirmais pasākums, kuru laikspiedolu vienāds vai vēlāku datetime argumentu. This option is useful for point-in-time recovery. Šī iespēja ir noderīga point-in-time atgūšanu. See the description of the –start-datetime option for information about the datetime value. Skatīt aprakstu-start-datetime iespēja sniegt informāciju par datetime vērtību.

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

Start reading the binary log at the first event having a position equal to the N argument. Noklausītos bināro log ir pirmais pasākums, kuru stāvoklis ir vienāds ar N argumentu. This option applies to the first log file named on the command line. Šāda iespēja ir attiecināma uz pirmā žurnāla Fails uz komandrindu.

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

Stop reading the binary log at the first event having a position equal or greater than the N argument. Jāpārtrauc lasīt bināro log ir pirmais pasākums, kuru stāvoklis ir vienāds vai lielāks par N arguments. This option applies to the last log file named on the command line. Šāda iespēja ir attiecināma uz pēdējo log faila nosaukums par komandrindu.

For more usage information on mysqlbinlog, visit Vairāk lietošanas informāciju par mysqlbinlog, apmeklējiet here šeit . .

IMPORTANT : The page is machine translated and provided "as is" without warranty. SVARĪGI: lapa mašīna iztulkot un pasniegts tàds, "kàds tas ir" bez garantijas. Machine translation may be difficult to understand. Mašīntulkošanu var būt grūti saprast. Please refer to Lūdzu, skatiet original English article oriģināls angļu rakstu whenever possible. kad vien iespējams.


2 Responses to “How to Read MySQL Binary Log Files (BinLog) with mysqlbinlog” 2 Atbildes uz "Kā Read MySQL Binary Log faili (BinLog) ar mysqlbinlog"

  1. nicolas Nicolas
    September 5th, 2009 05:04 5 septembris 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. Neaizmirstiet (as I did) izpildīt mysqlbinlog ar lietotāju, kam ir atļauja lasīt binlog vai sudo strādā labi too.

  2. Pisu Pisu
    June 29th, 2008 16:33 Jūnijs 29, 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!! Šo ziņu saglabāti mana dzīve šodien ... kad bināro log bija vienīgais veids, kā iegūt svarīgu datu pazust ... 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> Jūs varat izmantot šos tagus: <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. Parakstīties uz komentāriem iezīme ir atspējota. To receive notification of latest comments posted, subscribe to Saņemt informāciju par jaunāko komentārus, parakstīties uz My Digital Life Comments RSS feed Mana Digital Life Comments RSS feed or vai register to receive reģistrēties, lai saņemtu new comments in daily email digest. jauni komentāri ikdienas e-pasta sagremot.
Custom Search

New Articles Jauns pants

Incoming Search Terms for the Article Ienākošo Meklēt noteikumi pants

mysql binary log mysql bināro log - -- mysqlbinlog command mysqlbinlog komanda - -- mysqlbinlog mysqlbinlog - -- binlog mysql binlog mysql - -- mysql bin log reader mysql bin log lasītājs - -- reader mysql binary log lasītājs mysql bināro log - -- reading mysql-bin logs lasījums mysql-bin logs - -- view mysql binary log lai mysql bināro log - -- view mysql bin-log lai mysql bin-log - -- windows mysqlbinlog logi mysqlbinlog - -- BINLOG BINLOG - -- mysql binary log view mysql bināro log viedokli - -- mysql transaction log view mysql darījumu žurnālu, lai - -- binlog database upgrade binlog datu bāzes uzlabošana - -- how to read binary text Kā lasīt divkāršo tekstu - -- how to read from mysql kā nolasīt no mysql - -- how to read mysql binary logs Kā lasīt mysql bināro logs - -- log mysql-bin log mysql-bin - -- mysql read bin logs mysql lasīt bin logs - -- mysqlbinlog ubuntu examples mysqlbinlog Ubuntu piemēri - -- mysql reading transaction log mysql lasījums darījumu žurnālu - -- mysql bin logs mysql bin logs - -- MySQL+reading binary logs MySQL + lasījums binārs logs - -- mysql search binary log mysql meklēšana bināro log - -- mysql read bin log file mysql lasīt bin log failu - -- mysql binlog programming interface mysql binlog programmēšanas interfeisu - -- mysql bin log viewer mysql bin log viewer - -- mysqlbinlog howto mysqlbinlog HOWTO - -- mysql binlogs mysql binlogs - -- mysql binlog viewer mysql binlog skatītājs - -- mysqlbinlog usage mysqlbinlog izmantošana - -- mysqlbinlog error relay log mysqlbinlog kļūda relejs log - -- mysql log viewer mysql log viewer - -- mysql-bin analyze mysql-bin analizēt - -- MySQLBinlog.java+samples MySQLBinlog.java + paraugi - -- read mysql bin log to a file lasīt mysql bin žurnāla failu - -- read mysql binary log lasīt mysql bināro log - -- view mysql log lai mysql log - -- viewing mysql binary logs skatīšanas mysql binārs logs - -- binlogs howto binlogs HOWTO - -- examine mysql-bin pārbaudīt mysql-bin - -- hot to read mysql error log karsts lasīt mysql kļūdu log - -- How would you get a listing of all binary log files? Kā jums norādot visas bināro log failus? - -- how to read binlog Kā lasīt binlog - -- how to read mysql query log Kā lasīt mysql query log - -- how to read from msql kā nolasīt no msql - -- mssql read bin file MSSQL lasīt bin failu - -- mysql logfile command mysql logfile komanda - -- mysql-bin files mysql-bin faili - -- mysql binary log viewer mysql bināro log viewer - --