Turning Off Binary Logs For MySQL On Ubuntu

Binary logs in MySQL are enabled by default in MySQL 8.0. They are used for replication and point in time backup recovery, but are not always required.

As they are enabled by default, when you upgrade to MySQL 8.0 you need to be sure that you need them or you will find that you disk quickly fills with data.

To turn this off on Ubuntu you need to find the configuration file located at "/etc/mysql/mysql.conf.d/mysqld.cnf". This won't work if you edit a configuration file that MySQL doesn't pick up.

In the section marked with "[mysqld]" (for the MySQL daemon) add the following clause.

skip-log-bin

Restart MySQL for this setting to take effect.

sudo service mysqld restart

To check that the binary log is off run the following SQL.

SELECT * FROM performance_schema.global_variables WHERE VARIABLE_NAME IN ('log_bin');

This should show you the following.

+---------------+----------------+
| VARIABLE_NAME | VARIABLE_VALUE |
+---------------+----------------+
| log_bin       | OFF            |
+---------------+----------------+
1 row in set (0.03 sec)

Binary logs will now be off.

Please make sure that you do not want the binary logs to be on before disabling them.

Add new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
3 + 12 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.