These instructions are specifically for environments using Cloud IDE.
Binary logging (binlog) in MySQL enables replication and data recovery. If you do not require these features, disable binlog to improve performance and reduce disk usage. This article provides step-by-step instructions on how to disable binlog in MySQL 8 within the Cloud IDE.
If binlog is enabled, existing log files can consume significant disk space. You must manually purge these files.
To purge existing binlogs:
To confirm that binlog is active and to identify the log files, run:
drush sqlq "SHOW VARIABLES LIKE 'log_bin';"
drush sqlq "SHOW BINARY LOGS;"The system displays log_bin ON.
To purge all binlog files created before a specific file, such as binlog.000076, run:
drush sqlq "PURGE BINARY LOGS TO 'binlog.000076';"This command removes all logs listed before the specified filename.
To disable binlog in Cloud IDE:
Edit the MySQL configuration file.
/home/ide/configs/mysql/settings.cnfLocate the [mysqld] section in the file and add the following line to disable binlog:
skip-log-binFor example:
[mysqld]
skip-log-binRestart the MySQL service to apply the changes. Run the following command:
acli ide:service-restart mysqlRun the following command to verify that binlog is disabled:
drush sqlq "SHOW VARIABLES LIKE 'log_bin';"The following output is displayed:
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| log_bin | OFF |
+---------------+-------+To re-enable binlog in the future, remove or comment out the skip-log-bin line and restart MySQL.