How to Read MySQL Binary Log Files (BinLog) with mysqlbinlog Come leggere MySQL Binary file di log (BinLog) con 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 database server binario genera file di log per ogni transazione alle basi di dati, a condizione che l'amministratore non disattivare o commentare il "log-bin" parametro my.cny file di configurazione. The binary log files are written in binary format. I file di log binario sono scritti in formato binario. 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. Anche se il log binario, o anche conosciuto come logbin sono utilizzati principalmente per database MySQL scopo di replica, a volte può essere necessario esaminare o di leggere il contenuto di log binario in formato testo, dove l'utilità mysqlbinlog entrano a portata di mano.

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. File di log binario, che normalmente è il nome con il formato host_name-bin.xxxxxx e conservare in / var / lib / mysql directory, non poteva essere aperto e letto subito come è illeggibile in formato binario. 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. Per leggere il log binario in formato testo, siamo in grado di avvalersi di mysqlbinlog comando, che anche in grado di readrelay file di log scritto da un server slave in una configurazione di replica. Relay logs have the same format as binary log files. Relè log hanno lo stesso formato file di log binario.

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: Per utilizzare mysqlbinlog utilità è semplice, basta utilizzare il comando seguente sintassi per richiamare mysqlbinlog dopo aver eseguito il login come root (altrimenti si deve specificare il nome utente e password) tramite SSH shell:

mysqlbinlog [options] log_file … mysqlbinlog [opzioni] log_file…

So to read and display the contents of the binary log file named binlog.000001, use this command: In modo di leggere e di visualizzare il contenuto dei file di log binario di nome binlog.000001, utilizzare questo comando:

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. I file di log binario e dei suoi dati sono suscettibili di essere molto grande, rendendo così quasi impossibile leggere qualcosa sullo schermo. 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: Tuttavia, è possibile pipe l'output di mysqlbinlog in un file che può essere aperto per più tardi navigando in editor di testo, utilizzando il seguente comando:

mysqlbinlog binlog.000001 > filename.txt mysqlbinlog binlog.000001> nomefile.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. Per ridurre la quantità di dati estratti da registri binari, ci sono diverse opzioni che possono essere utilizzati per limitare i dati che è stato restituito. Among the useful ones are listed below: Tra gli utili sono quelli elencati di seguito:

–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. Avviare la lettura del binario di log al primo evento che hanno un timestamp pari o entro la datetime argomento. The datetime value is relative to the local time zone on the machine where you run mysqlbinlog. Datetime il valore è relativo al fuso orario locale sulla macchina in cui viene eseguito mysqlbinlog. The value should be in a format accepted for the DATETIME or TIMESTAMP data types. Il valore dovrebbe essere in un formato accettato per la DateTime o TIMESTAMP tipi di dati. For example: Per esempio:

mysqlbinlog --start-datetime="2005-12-25 11:25:56" binlog.000001 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. Fermare la lettura binaria di log al primo evento che hanno un timestamp pari o posteriore alla datetime argomento. This option is useful for point-in-time recovery. Questa opzione è utile per il punto-in-time di recupero. See the description of the –start-datetime option for information about the datetime value. Vedere la descrizione del-start-datetime opzione per informazioni sul datetime valore.

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

Start reading the binary log at the first event having a position equal to the N argument. Avviare la lettura del binario di log al primo caso con una posizione pari al N argomento. This option applies to the first log file named on the command line. Questa opzione vale per il primo file di registro denominato sulla riga di comando.

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

Stop reading the binary log at the first event having a position equal or greater than the N argument. Fermare la lettura binaria di log al primo caso con una posizione uguale o maggiore di N argomento. This option applies to the last log file named on the command line. Questa opzione vale per l'ultimo file di registro denominato sulla riga di comando.

For more usage information on mysqlbinlog, visit Per ulteriori informazioni su uso mysqlbinlog, visitare here qui .

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Questa è una pagina tradotta macchina che è fornito "così com'è" senza alcuna garanzia. Machine translation may be difficult to understand. Traduzione automatica può essere difficile da capire. Please refer to Si prega di fare riferimento a original English article articolo originale inglese whenever possible. quando possibile.

Share and contribute or get technical support and help at Condividere e contribuire o ottenere supporto tecnico e assistenza in My Digital Life Forums La mia vita digitale Forum .



One Response to “How to Read MySQL Binary Log Files (BinLog) with mysqlbinlog” Una risposta a "Come leggere MySQL Binary file di log (BinLog) con mysqlbinlog"

  1. Pisu
    June 29th, 2008 16:33 29 giugno 2008 16:33
    1

    This post saved my life today… when the binary log were the only way to retrieve important data get lost… thanks!! Questo post salvato la mia vita di oggi… quando il binario di log sono stati l'unico modo per recuperare i dati importanti si perdono… grazie!

Leave a Reply Lasciare una risposta

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> È possibile utilizzare questi tag: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q Cite=""> <strike> <strong>

Subscribe without commenting Iscriviti senza commentare


Custom Search

New Articles Nuovi articoli

Incoming Search Terms for the Article Cerca in arrivo Condizioni per l'articolo

mysqlbinlog mysqlbinlog - -- BINLOG BINLOG - -- mysql binary log MySQL binario di log - -- mysql logs MySQL log - -- mysql binlogs MySQL binlogs - -- mysql log file MySQL file di log - -- read mysql logs MySQL leggere i log - -- mysql log reader MySQL lettore di log - -- mysql log files MySQL file di log - -- read mysql log leggere MySQL log - -- mysql binary log reader MySQL lettore di log binario - -- mysql binary logs MySQL log binario - -- mysql read bin log MySQL leggere bin log - -- reading mysql logs MySQL lettura log - -- mysql binlog MySQL binlog - -- how to read mysql log come leggere MySQL log - -- mysql log read MySQL log leggere - -- mysql read log MySQL leggere log - -- mysql binlog format MySQL binlog formato - -- mysql bin log reader MySQL bin lettore di log - -- mysql binlog reader MySQL binlog lettore - -- mysql bin log MySQL bin log - -- binlog mysql binlog MySQL - -- read mysql bin log MySQL leggere bin log - -- mysql binary log format MySQL binario formato log - -- mysql binary log files MySQL file di log binario - -- mysql binary MySQL binario - -- mysql binary logging MySQL binario di registrazione - -- mysql log format MySQL formato log - -- mysqlbinlog example mysqlbinlog esempio - -- mysqlbinlog usage mysqlbinlog uso - -- binary log log binario - -- read binlog leggere binlog - -- read mysql binlog MySQL leggere binlog - -- reading mysql bin logs MySQL lettura bin log - -- mysql bin log export MySQL bin esportazione di log - -- binlogs in mysql binlogs in MySQL - -- mysqlbinlog mysqlbinlog - -- how to read mysql bin log come leggere mysql bin log - -- how to read mysql binlog come leggere MySQL binlog - -- mysql logging MySQL registrazione - -- mysql binary log location MySQL posizione di log binario - -- mysql log files windows MySQL file di registro di Windows - -- binlogs mysql binlogs MySQL - -- mysql read log file MySQL leggere file di log - -- how to read mysql binary log come leggere mysql log binario - -- how to read mysql-bin come leggere mysql-bin - -- mysql read logs MySQL leggere i log - -- how to read mysql log file come leggere file di log mysql - -- how to read mysql binary logs come leggere mysql log binario - --