Thursday, September 6, 2012

MySQL Strict Mode reference - sql_mode



http://www.mysqlfaqs.net/mysql-faqs/Client-Server-Commands/What-is-sql-mode-in-MySQL-and-how-can-we-set-it


To check the current sql_mode setting, select its value like this:
SELECT @@sql_mode;


To set it to STRICT:

SET sql_mode=TRADITIONAL;
SELECT @@sql_mode;


To set it to relaxed, use empty string '':

SET sql_mode='';
SELECT @@sql_mode;




http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html


  • Make MySQL behave like a traditional SQL database system. A simple description of this mode is give an error instead of a warning when inserting an incorrect value into a column.
    Note
    The INSERT/UPDATE aborts as soon as the error is noticed. This may not be what you want if you are using a nontransactional storage engine, because data changes made prior to the error may not be rolled back, resulting in a partially done update. (Added in MySQL 5.0.2)
When this manual refers to strict mode, it means a mode where at least one of STRICT_TRANS_TABLES orSTRICT_ALL_TABLES is enabled.


how to set strict mode for mysql table? - Google Search

No comments:

Post a Comment