Is there a way to disable MySQL binary logs?

I’m running Local Lightning v5.0.6+976 on a Mac v10.14.5. I’ve got a site with a large database, and MySQL is continuously creating binary logs for it. These logs are an average of 1Gb per file, and it creates at least 10 of them.

The path for these logs is /Users/robert/Library/Application Support/Local/run/Zvhz8Drio/mysql-raw-data/. (Zvhz8Drio seems to be a random ID assigned to this site.)

Is there a way to disable these logs? I’ve seen articles that say that in general they can be disabled by adding the following to my.cnf:

[mysqld]
skip-log-bin

When I add this and then restart the site, my changes go away. You probably have a default template that just gets applied on site startup.

I also tried putting this in a custom config file at ~/.my.cnf, but that also doesn’t work.

Are there other ways to apply my changes to MySQL for Local Lightning sites?

Thanks in advance!

1 Like

Never mind, I figured it out. For future searchers, there’s a file in SITENAME/conf/mysql called my.cnf.hbs. It’s the default template for that site.

I added skip-log-bin to the already-existing [mysqld] section, then stopped and restarted the site container. Bin logging is now disabled! (You can tell by running this MySQL command - SHOW VARIABLES LIKE 'log_bin';

Having said all that, is there any reason I shouldn’t be altering my.cnf.hbs? Is it as bad as hacking core?

1 Like