Did you want MySQL to turn off Binary logging in MySQL? The below article explains an easy way to disable binary logging.

If you have a cloud server with less disk space, it is better to disable the MySQL bin log as it takes about 3 GB of disk space on the Bitnami server.

Before we get begun, load the Bitnami stack environment. You can do this either by executing the installdir/use_APPNAME script or navigating to Start> Bitnami APPNAME Stack> Application console in the Start Menu.

Now, let’s get down to disabling binary logging in MySQL.

You can disable the binary logging in MySQL on Bitnami Servers by doing the below 4 steps given:

1. Stop the MySQL server using the command given below:

sudo /opt/bitnami/ctlscript.sh stop mysql

2. Edit the MySQL configuration file, depending on your installation type

For Bitnami installations using Linux system packages: */opt/bitnami/mysql/conf/my.cnf*

For Self-contained Bitnami installations:: */opt/bitnami/mysql/my.cnf*

3. Add the line `disable_log_bin` below in the [mysqld] configuration block.

After adding the line, the conf will look like as shown below:


4. Start the MySQL server with the following command:

sudo /opt/bitnami/ctlscript.sh start mysql

Moreover, the current binary logs will be terminated after 30 days, the default expiry period. In addition, you can also remove them manually.

For removing binary log files manually, run the commands shown below in the MySQL command prompt after logging in as MySQL root user.

PURGE BINARY LOGS TO 'bin_log000056';
PURGE BINARY LOGS BEFORE '2022-01-11 15:42:10';

The BEFORE variant’s datetime_expr argument should evaluate a DATETIME value (a value in ‘YYYY-MM-DD hh:mm: ss’ format). Also, use the correct log term specified in the server in place of ‘bin_log000056’.

The binary logs will be removed once running these commands.

?האם התשובה שקיבלתם הייתה מועילה 0 משתמשים שמצאו מאמר זה מועיל (0 הצבעות)