MySQL’s binary logs contain “events” that describe changes to the database, such as table creation operations or changes to data in the table. It also contains events for statements that may have made changes (for example, a DELETE). The binary log also contains information about how long each statement took to update this data. The binary journal has two important purposes:
– For replication (only if Open Bee Portal is configured in high availability mode), the binary log on a replication source server provides a record of data changes to be sent to replicas. The source sends the events contained in its binary log to its replicas, which execute those events to make the same data changes as those made to the source.
– Some data retrieval operations require the use of the binary log. After a backup is restored, the binary log events that were logged after the backup are replayed. These events update the databases from the time of backup.
After some time of using Open Bee Portal and depending on the level of use, it may turn out that the volume occupied by these binary logs becomes large in the folder “C:\Program Files (x86)\OpenBee\OpenBeePortal5\mysql\data”
We do not recommend disabling this logging, for the reasons explained above.
But it is possible to set a number of days after which binary log files will be automatically deleted.
To make this setup:
1/ Open the file “C:\Program Files (x86)\OpenBee\OpenBeePortal5\mysql\my.ini” in a text editor and look for the log-bin variable:

2/ The following line must be added:
expire_logs_days=X
With X = number of days of retention (number of days of log files to keep in the data folder)
Note: If you are using replication, you should not set the variable below the maximum number of days that your replicas can lag behind the source.
For example, if you want to keep the last 30 days of binary:

3/ Restart the MySQL and Apache service


Verification to be carried out:
– The date of the mysql-bin files in the data folder must be less than or equal to the number of days of retention set up.
– Disk space has been successfully freed up in the mysql/data folder
– MySQL server and Apache restarted without error
– It is possible to log in to OpenBee Portal