nativeInstallerspree

Disable binary logging in MySQL

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and MacOS) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). On OS X VMs, the installation directory is /opt/bitnami and OS X VM users can click the “Open Terminal” button to run commands. Learn more about the Bitnami stack environment and about OS X VMs.

NOTE: The Approach A sections referred to below do not apply to Bitnami native installers. Users of Bitnami native installers should refer only to the Approach B sections.

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

  • Stop the MySQL server:

      $ sudo installdir/ctlscript.sh stop mysql
    
  • Edit the MySQL configuration file, which depending on your installation type will be in one of the following locations:

      * For Bitnami installations following Approach A (using Linux system packages): *installdir/mysql/conf/my.cnf*
      * For Bitnami installations following Approach B (self-contained installations): *installdir/mysql/my.cnf*
    
  • 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 installdir/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 June 16, 2021