Published on: January 6, 2022 by Abin Raaj
The binary log is a set of log files that contain information about data modifications made to a MySQL server instance. The log is enabled by starting the server with the –log-bin option. It was introduced in MySQL 3.23.14. There are two types of binary logging:
In earlier MySQL versions, binary logging was disabled by default but from MySQL 8.0, binary logging is enabled by default. When binary logging is enabled, it may consume more disk space. MySQL database performance and connectivity can be affected by low disk space and/or low available memory. We can disable binary logging by specifying the –skip-log-bin or –disable-log-bin option at startup.
Disabling the binary logging in Bitnami can be done using the steps given below:
For Bitnami installations using Linux system packages: /opt/bitnami/mysql/logs/mysqld.log For Self-contained Bitnami installations: /opt/bitnami/mysql/data/mysqld.log
sudo /opt/bitnami/ctlscript.sh stop mysql
For Bitnami installations using Linux system packages: */opt/bitnami/mysql/conf/my.cnf* For Self-contained Bitnami installations: */opt/bitnami/mysql/my.cnf*
[mysqld] disable_log_bin ...
sudo /opt/bitnami/ctlscript.sh start mysql
Now the binary logging will be disabled and the existing binary log files will be automatically removed after 30 days, which is the default expiry period.
To remove the binary log files manually, run the commands given below in the MySQL command prompt after logging in as MySQL root user.
PURGE BINARY LOGS TO 'bin_log000095'; PURGE BINARY LOGS BEFORE '2021-04-02 22:30:20';
The BEFORE variant’s datetime_expr argument should evaluate to a DATETIME value (a value in ‘YYYY-MM-DD hh:mm:ss’ format). Also, don’t forget to use the appropriate log name (as specified in the server) in place of ‘bin_log000095’.
After running these commands, the binary logs will be removed.
We are one of the best Server Management Company in India, Our expert team in web hosting and server management provides professional helpdesk support around the clock with guaranteed response and resolution time.
Get rid of all the hassles of server management.
CONTACT US WITH YOUR REQUIREMENTS!
Category : Linux