What is the method to disable MySQL binlog?

There are two methods to disable MySQL’s binlog:

  1. Disable the binlog function in MySQL by modifying the configuration file. Locate the MySQL configuration file my.cnf (or my.ini), add a line “skip-log-bin” under [mysqld], save the file, and restart the MySQL service. This will effectively disable the binlog feature.
  2. To disable the binlog, execute the command SET GLOBAL expire_logs_days = 0; in the MySQL command line. This command sets the retention time of binlogs to 0, meaning all binlog files are immediately deleted, effectively turning off the binlog function.
广告
Closing in 10 seconds
bannerAds