A new poll we’re running on the MySQL web site shows that a lot of folks still aren’t familiar with the strict mode/sql mode setting that was introduced with MySQL 5.0. The sql_mode parameter allows you to have MySQL better enforce data integrity in terms of what data is accepted/rejected by the server. Not having this capability produced a number of gotchas in previous MySQL versions, but in 5.0, these all go away.
The sql_mode config parameter is very flexible in terms of how strong/lax you want to be with respect to having MySQL enforce data integrity. For more information on all the options available to you with the sql_mode parm, see the MySQL Manual. And for a quick primer on sql_mode and how to use it, you can …
[Read more]