Home > database >  what is the use of DESKTOP-7JFP5MF-bin.000001 files in data folder in mysql database?
what is the use of DESKTOP-7JFP5MF-bin.000001 files in data folder in mysql database?

Time:10-11

I just wanted to know use of this type of file "DESKTOP-7JFP5MF-bin.000001" in data folder mysql server in windows 10? have a look on below files.

  1. what is the use of these files?
  2. what if we delete these files?

enter image description here

Thanks

CodePudding user response:

These files are the binary log, which is a sequential log of changes to your database.

It is used primarily for replication. A replica MySQL Server instance downloads these files and applies the same changes in the same order to the replica instance. The replica instance may be restarted or go offline temporarily, and when it reconnects to the source it will resume downloading where it left off. So it can be handy to keep the binary log files around for some time.

Typically they are set to expire automatically after a day (this is configurable). If a given log file is expired and deleted on the source instance before the replica has downloaded it, the replica will miss some updates. It needs all the logs to be a true replica, so if it misses some, it's essentially a failed replica and needs to be scrapped and reinitialized with a fresh copy from the source.

So if you delete these files, you'll spoil the replica.

Read https://dev.mysql.com/doc/refman/8.0/en/binary-log.html and its subsections for more information on the binary log.

  • Related