January 2018
Intermediate to advanced
446 pages
12h 57m
English
Execute the mysqlbinlogpurge script on any of the servers and specify the master and slave hosts. The script connects to all the slaves and finds out the latest binary log applied. Then it purges the master binary logs until that point. You need a superuser to connect to all slaves:
shell> mysqlbinlogpurge --master=dbadmin:<pass>@master:3306 --slaves=dbadmin:<pass>@slave1:3306,dbadmin:<pass>@slave2:3306
mysql> SHOW BINARY LOGS;+--------------------+-----------+| Log_name | File_size |+--------------------+-----------+| master-bin.000001 | 177 |~| master-bin.000018 | 47785 || master-bin.000019 | 203 || master-bin.000020 | 203 || master-bin.000021 | 177 ...