MySQL 8.0 – How to Disable Binary Logs

logMySQLmysql-8.0

How can I disable binary logging on MySQL 8.0?

I am needing to import a large MySQLDump file, and don't want to fill the Binary logs with many GB of data. In the past I would have set log_bin=0 in the my.cnf and restarted the database.

But with MySQL 8.0 I have tried various settings, but everytime I log onto the database, and run:

SELECT @@global.log_bin;

and it keeps returning 1

I have tried:

log_bin = 0
log_bin = OFF
#log_bin = 1

Is it possible to disable to the binary logs?

Best Answer

In addition to specifying the corresponding command line argument, you can also add an option to my.cnf:

  1. Edit my.cnf and add skip-log-bin in the [mysqld] section.

  2. Restart mysqld

  3. Enjoy your lack of binlogs

Note that this will remain in effect until you remove the option from the configuration file.