How to Set Global SQL Mode on MySQL Clusters

MySQL can operate in different SQL modes. Global SQL modes affect the SQL syntax MySQL supports and the data validation checks it performs.

To set the global SQL mode for a MySQL Cluster, find the cluster on the Databases page and then click the cluster’s name. From there, click the Settings tab to view the settings for the cluster.

Screenshot of MySQL Cluster settings page

Find the Global SQL mode setting. Here you see the current SQL modes in use. To make changes, click the Edit button to the right.

Select an available SQL mode from the drop-down menu or start typing the name of a mode to select from the results that match. When you’re finished, click the Save button to apply the changes or the Cancel button to cancel editing. You can click the Reset to the default MySQL 8 SQL modes links to revert to the default settings.

Screenshot of MySQL SQL Mode edit

The default SQL modes for MySQL on Managed Databases are as follows:

  • ANSI (shorthand)
  • ERROR_FOR_DIVISION_BY_ZERO
  • NO_ENGINE_SUBSTITUTION
  • NO_ZERO_DATE
  • NO_ZERO_IN_DATE
  • STRICT_ALL_TABLES
  • ALLOW_INVALID_DATES

See the official MySQL 8 documentation for a full list of supported SQL modes.