CertGrid CertGrid
Concepts·MySQL

MySQL SQL Mode and Strict Behaviour

`sql_mode` decides whether bad data is an error or a silent correction. Relaxing it turns the out-of-range failure from the constraints guide into a row that stores 99999999.99 and says nothing.

Configuration Guide 15 of 45 Intermediate

Written against the versions above. Strict mode has been the default since 5.7. Servers upgraded from 5.6 often carry a relaxed `sql_mode` forward in their config, which is where most surprises of this kind come from.

Every command on this page ran on db-a01.
Server NameIP AddressOSRolesCPURAMHDD
db-a01192.168.0.81Ubuntu 26.04 LTSPrimary / Source / Replica Set Member 12 Core4 GB50 GB

Before you start

  1. Read the modes this server enforces

  2. Turn strict mode off and repeat a statement that failed

  3. Confirm the bad row is really there

Official sources