Skip to content

MySQL on Amazon, Azure and Google Cloud

On these services, your service's section replaces Turn on the binary log, Keep the binary log long enough and Let the agent create its function.

Amazon Aurora MySQL and Amazon RDS

Amazon RDS sets server settings in parameter groups. A default parameter group can't be changed: create a custom one from the same family (for example mysql8.0), and attach it.

  1. Binary log.
    • Amazon RDS for MySQL or MariaDB: the binary log is on when automated backups are on (a backup retention period greater than 0). In a custom DB parameter group, set binlog_format to ROW. Select the instance, choose Modify, select the parameter group, choose Apply immediately, and reboot the instance.
    • Amazon Aurora MySQL: the binary log is off until binlog_format is set. In a custom DB cluster parameter group, set binlog_format to ROW. Modify the cluster to use the group, choose Apply immediately, and reboot the cluster's instances.
  2. Retention. Amazon RDS removes binlog files as soon as it can, unless you keep them for a number of hours (at most 168 on Amazon RDS for MySQL). Run, as the master user:

    CALL mysql.rds_set_configuration('binlog retention hours', 24);
    

    See mysql.rds_set_configuration (AWS). 3. Function. In the parameter group, set log_bin_trust_function_creators to 1 (no reboot needed; see Let the agent create its function). Set it back after the agent's first start.

Check the settings with the queries in Turn on the binary log.

Azure Database for MySQL

In Azure Database for MySQL - Flexible Server, the binary log is always on, in row format, and log_bin_trust_function_creators is on by default.

  • Retention: the server parameter binlog_expire_logs_seconds defaults to 0, which removes a binlog file as soon as nothing is reading it, so files can be removed while the agent is stopped. Set it (in the Azure portal, your server > Server parameters) to longer than the agent may be stopped.
  • Table names: set the agent's lowerCaseTables property after you add it (see Settings).

Google Cloud SQL for MySQL

  • Binary log: it must be on for the instance. It's part of the instance's backup settings (in the Google Cloud console, edit the instance), or run:

    gcloud sql instances patch INSTANCE_NAME --enable-bin-log
    
  • Function: set the database flag log_bin_trust_function_creators to on (see Let the agent create its function): in the console, edit the instance and add it under Flags, or run the command below. --database-flags replaces all the instance's flags: list the existing ones too.

    gcloud sql instances patch INSTANCE_NAME --database-flags=log_bin_trust_function_creators=on
    

Check the settings with the queries in Turn on the binary log.