How to Read MySQL Binary Log Files (BinLog) with mysqlbinlog Comment MySQL Lire le log binaire (binlog) avec 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. Serveur de base de données MySQL génère des fichiers de log binaire pour chaque transaction aux bases de données, à condition administrateur n'a pas à désactiver ou à commenter le "log-bin" my.cny paramètre dans le fichier de configuration. The binary log files are written in binary format. Le binaire des fichiers de log sont écrits en format binaire. 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. Bien que les logs binaires, ou également connu sous le nom de logbin sont principalement utilisés pour la réplication de base de données MySQL effet, parfois vous mai nécessité d'examiner ou de lire le contenu des logs binaire au format texte, où l'utilitaire mysqlbinlog vous sera utile.

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. Fichier de log binaire, qui a normalement nom au format host_name-bin.xxxxxx et stocker dans / var / lib / mysql répertoire, n'a pas pu être ouverts et lus immédiatement comme il est illisible en format binaire. 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. Pour lire les logs binaire au format texte, nous pouvons utiliser la commande mysqlbinlog, qui a également en mesure de readrelay fichiers de log écrits par un serveur esclave dans une configuration de réplication. Relay logs have the same format as binary log files. Logs de relais ont le même format que les fichiers de log binaire.

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: Pour utiliser mysqlbinlog utilité est simple, il suffit d'utiliser la syntaxe de commande suivante à invoquer mysqlbinlog après la connexion en tant que root (sinon, vous devez spécifier le nom d'utilisateur et mot de passe) de bombarder par SSH:

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

So to read and display the contents of the binary log file named binlog.000001, use this command: Donc, pour lire et afficher le contenu du fichier de log binaire binlog.000001 nom, utilisez cette commande:

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. Le log binaire des fichiers et les données sont susceptibles d'être très vaste, ce qui rend presque impossible de lire quoi que ce soit sur écran. 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: Toutefois, vous pouvez le tuyau de sortie de mysqlbinlog dans un fichier que l'on peut ouvrir plus tard pour la navigation dans l'éditeur de texte, en utilisant la commande suivante:

mysqlbinlog binlog.000001 > filename.txt mysqlbinlog binlog.000001> nomfichier.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. Pour réduire la quantité de données extraites de logs binaires, il existe plusieurs options qui peuvent être utilisés pour limiter les données qui sont été restitués. Among the useful ones are listed below: Parmi les plus utiles sont énumérés ci-dessous:

–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. Commencer à lire le log binaire à la première manifestation d'un horodatage égal à ou plus tard que la date / heure argument. The datetime value is relative to the local time zone on the machine where you run mysqlbinlog. La valeur datetime est relatif au fuseau horaire local sur l'ordinateur sur lequel vous exécutez mysqlbinlog. The value should be in a format accepted for the DATETIME or TIMESTAMP data types. La valeur doit être dans un format accepté pour la DATETIME ou TIMESTAMP types de données. For example: Par exemple:

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. Arrêtez de lire le log binaire à la première manifestation d'un timestamp égale ou postérieure à la date / heure argument. This option is useful for point-in-time recovery. Cette option est utile pour le point-à-temps de récupération. See the description of the –start-datetime option for information about the datetime value. Voir la description de la start-datetime option pour obtenir des informations sur la valeur datetime.

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

Start reading the binary log at the first event having a position equal to the N argument. Commencer à lire le log binaire à la première manifestation ayant une position égale à l'argument N. This option applies to the first log file named on the command line. Cette option s'applique au premier fichier journal nommé sur la ligne de commande.

–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. Arrêtez de lire le log binaire à la première manifestation ayant une position supérieure ou égale à l'argument N. This option applies to the last log file named on the command line. Cette option s'applique au dernier fichier journal nommé sur la ligne de commande.

For more usage information on mysqlbinlog, visit Pour de plus amples informations sur l'utilisation mysqlbinlog, consultez le site here ici .

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANT: Il s'agit d'une machine qui traduit la page est fourni «tel quel», sans garantie. Machine translation may be difficult to understand. La traduction automatique mai être difficile à comprendre. Please refer to S’il vous plaît se référer à original English article article original anglais whenever possible. chaque fois que possible.

Share and contribute or get technical support and help at Partagez et contribuer ou obtenir de l'aide technique et l'aide à My Digital Life Forums Ma vie numérique forums .



One Response to “How to Read MySQL Binary Log Files (BinLog) with mysqlbinlog” Une réponse à "Comment MySQL pour lire le log binaire (binlog) avec mysqlbinlog"

  1. Pisu
    June 29th, 2008 16:33 29ème Juin, 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!! Ce poste m'a sauvé la vie d'aujourd'hui… lorsque le log binaire sont le seul moyen de récupérer des données importantes se perdre… merci!

Leave a Reply Laisser un commentaire

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> Vous pouvez utiliser ces balises: <a href="" title="fete_christel <abbr title="fete_christel <acronym title="fete_christel <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q Cite=""> <strike> <strong>

Subscribe without commenting S'abonner sans commentaires


Custom Search

New Articles Nouveaux Articles

Incoming Search Terms for the Article Des termes de recherche utilisés pour l'article

mysqlbinlog mysqlbinlog - -- BINLOG BINLOG - -- mysql binary log MySQL log binaire - -- mysql logs MySQL journaux - -- mysql binlogs MySQL binlogs - -- read mysql logs MySQL lire les journaux - -- mysql log file MySQL fichier journal - -- read mysql log lire MySQL journal - -- mysql log reader MySQL lecteur de journal - -- mysql log files MySQL fichiers de log - -- mysql binary log reader log binaire MySQL lecteur - -- reading mysql logs MySQL lecture journaux - -- mysql binary logs logs binaires MySQL - -- how to read mysql log comment lire MySQL journal - -- mysql read bin log MySQL lire bin log - -- mysql log read MySQL log lire - -- mysql binlog format MySQL binlog format - -- mysql binlog MySQL binlog - -- mysql read log MySQL lire journal - -- mysql bin log reader MySQL bin connecter lecteur - -- mysql bin log MySQL bin log - -- mysql binary log files MySQL fichiers log binaire - -- binlog mysql MySQL binlog - -- mysql log format MySQL format de journaux - -- mysql binlog reader MySQL binlog lecteur - -- mysqlbinlog example mysqlbinlog exemple - -- read mysql bin log lire MySQL bin log - -- binary log log binaire - -- read binlog lire binlog - -- mysql binary logging le log binaire MySQL - -- mysqlbinlog usage mysqlbinlog utilisation - -- reading mysql bin logs lecture MySQL bin journaux - -- mysql binary log format MySQL journal format binaire - -- mysql bin log export MySQL bin journal exportation - -- binlogs in mysql binlogs en MySQL - -- mysqlbinlog mysqlbinlog - -- mysql binary MySQL binaire - -- how to read mysql bin log comment lire mysql bin log - -- mysql logging MySQL exploitation forestière - -- mysql binary log location log binaire MySQL emplacement - -- mysql log files windows MySQL fichiers journaux Windows - -- how to read mysql binary log comment lire mysql log binaire - -- mysql read logs MySQL lire les journaux - -- how to read mysql log file comment lire mysql fichier journal - -- how to read mysql binary logs comment lire les journaux binaire mysql - -- tool read mysql binlog file outil de lire des fichiers MySQL binlog - -- how to read mysql binlog comment lire MySQL binlog - -- mysqlbinlog windows mysqlbinlog Windows - -- logs mysql journaux MySQL - -- change binlog position changement binlog position - --