Сведения о вопросе

CPdeveloper

09:16, 14th August, 2020

Теги

MySQL    

Удаление mysql-binlog'ов?

Просмотров: 407   Ответов: 3

Можно ли удалить binlog'и без опаски за репликацию БД? Что в этом случае делать с mysql-bin.index?

Заранее спасибо за ответы.



  Сведения об ответе

pumpa

07:29, 3rd August, 2020

лучше пусть мускул сам подчищает старые логи, например опция:
[mysqld]
. . .
expire_logs_days = 5
. . . 

заставит мускул чистить логи старше 5 дней.


  Сведения об ответе

DINO

18:53, 29th August, 2020

Можно вынести логи старше какой-то даты
PURGE MASTER LOGS BEFORE '2010-10-08 00:00:00';


  Сведения об ответе

lats

11:39, 1st August, 2020

Есть метод по нахождению тех логов, которые еще используются (не переданы на слэйвы)
Выдержка из dev.mysql.com/doc/refman/5.1/en/purge-binary-logs.htm
To safely purge binary log files, follow this procedure:
1. On each slave server, use SHOW SLAVE STATUS to check which log file it is reading.
2. Obtain a listing of the binary log files on the master server with SHOW BINARY LOGS.
3. Determine the earliest log file among all the slaves. This is the target file. If all the slaves are up to date, this is the last log file on the list.
4.Make a backup of all the log files you are about to delete. (This step is optional, but always advisable.)
5.Purge all log files up to but not including the target file.


Ответить на вопрос

Чтобы ответить на вопрос вам нужно войти в систему или зарегистрироваться