Can I safely delete .BAK files from mysql database?

When I look into my Drupal 6 database on a Linux machine, I see that these are clusters with many very large * .BAK files with names such as cache_form-110416043841.BAK. I am wondering if I can safely remove them? And if their removal is not recommended, what to use them?

+6
source share
1 answer

Take a look at your /etc/my.cnf file and you will probably see this line:

myisam-recover = BACKUP 

Or if you are using a newer version of MySQL:

 myisam-recover-options = BACKUP 

This is an option for the MyISAM storage engine. When recovery is turned on, when MySQL starts, if it detects that the MyISAM table crashed or was not closed correctly, it tries to automatically restore the table. With the BACKUP option, it also creates this .BAK copy of the table before attempting recovery.

If everything seems to be working fine after a safe period of time (30 days? YMMV), personally, Id feel comfortable deleting the old .BAK files *, but if there are a lot of them over a certain period of time, it continues to date, I probably I will try to identify the main problem that will lead to the failure of properly closed tables.

* The age of the BAK file can be determined by a simple stat command or a time stamp encoded in the file name: table-YYMMDDHHMMSS.BAK

+11
source

Source: https://habr.com/ru/post/886989/


All Articles