SQL Mode

SQL mode, or sql_mode is a MySQL system variable meant to configure operational characteristics of the MySQL server.

You apply SQL modes depending on the clients. You can change the SQL mode by using the sql_mode system variable.

There may be a global SQL mode for operating requirements, however you may specify an SQL mode specifically to a session if required. Modes affect the SQL syntax and data validation checks.

The default SQL modes are:

  • ONLY_FULL_GROUP_BY
  • STRICT_TRANS_TABLES
  • NO_ZERO_IN_DATE
  • NO_ZERO_DATE
  • ERROR_FOR_DIVISION_BY_ZERO
  • NO_AUTO_CREATE_USER
  • NO_ENGINE_SUBSTITUTION