Strict mode controls how MySQL handles invalid or missing values in statements that change data, such as in INSERT
and UPDATE
statements.
Strict mode (aka strict SQL mode) is in effect if either STRICT_ALL_TABLES
or STRICT_TRANS_TABLES
is enabled.
In MySQL 8.0, the default SQL mode includes STRICT_TRANS_TABLES
, which enables strict SQL mode for transactional storage engines, and when possible for nontransactional storage engines.
We can disable strict mode in our session by removing it from our @@sql_mode
variable. We can also disable strict mode at server startup, so that we don’t have to do it at runtime.