generalmysql

Disable binary logging in MySQL

Binary logging is enabled by default in MySQL 8.x and later. Follow the steps below to disable it:

  • Stop the MySQL server:

      $ sudo /opt/bitnami/ctlscript.sh stop mysql
    
  • Edit the /opt/bitnami/mysql/conf/my.cnf MySQL configuration file.

  • Add the line below in the [mysqld] configuration block, such that the result looks like this:

      [mysqld]
      disable_log_bin
      ...
    
  • Start the MySQL server:

      $ sudo /opt/bitnami/ctlscript.sh start mysql
    

Existing binary log files will be automatically removed after 30 days, which is the default expiry period. To remove them manually, use the PURGE BINARY LOGS command described in the official MySQL documentation.

Last modification February 9, 2023