From 8fe7e12a63e3dc50fe205f19a7cd99f65608abf9 Mon Sep 17 00:00:00 2001 From: bserie Date: Fri, 24 Jul 2020 10:51:42 +0200 Subject: [PATCH] =?UTF-8?q?pr=C3=A9cision=20mysqlbinlogpurge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HowtoMySQL.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/HowtoMySQL.md b/HowtoMySQL.md index 81c2d51d..6cb4044e 100644 --- a/HowtoMySQL.md +++ b/HowtoMySQL.md @@ -1364,15 +1364,22 @@ mysql> PURGE BINARY LOGS BEFORE "2011-12-07 00:00:00"; Si cela vient à se reproduire régulièrement, on peut baisser le nombre de jour durant lesquels les binlogs sont gardés avec la directive *expire_logs_days*. -On peut automatiser la tâche avec l'outil [mysqlbinlogpurge](https://dev.mysql.com/doc/mysql-utilities/1.6/en/mysqlbinlogpurge.html). +On peut automatiser la tâche avec l'outil mysqlbinlogpurge dispo via [mysql-utils](https://downloads.mysql.com/archives/utilities/). Il faudra aussi mysql-connector-python. Exemple : ``` -mysqlbinlogpurge --master=login:password@192.0.2.1:3306 --slaves=login:password@192.0.2.2:3306 +mysqlbinlogpurge --master=mysqladmin:PASSWORD@192.0.2.1:3306 --slaves=mysqladmin:PASSWORD@192.0.2.2:3306 --dry-run ``` **Note** : Il est nécessaire que le slave s'annonce avec --report-host et --report-port. +**Note** : Il est nécessaire de ne pas mettre localhost ni 127.0.0.1 pour --master, mais l'adresse IP principale. + +~~~ +[mysqld] +report-host = 192.0.2.1 +report-port = 3306 +~~~ ### Désactivation