How do I set the MySQL error level? Given the following table:



CREATE TABLE Test (
 id int(10) unsigned NOT NULL PRIMARY KEY,
 value int(10) unsigned NOT NULL
) ENGINE=InnoDB;


If I insert a value with only the id field set:

INSERT INTO Test (id) VALUES (1);


On my development server, I get a warning:


  Warning: #1366 Incorrect integer value: '' for column 'value' at row 1


On my production server, I get an error:


  ERROR 1364 (HY000): Field 'value' doesn't have a default value


What should I configure on my development server to make it behave like my production server?
Have a look at http://dev.mysql.com/doc/refman/5.5/en/sql-mode.html

You can set this for your current session, or in your mysql config

my.cnf (Unix operating systems) or my.ini (Windows)

sql-mode="modes"


On your production server use the following query to determine the current mode:

SELECT @@GLOBAL.sql_mode;
SELECT @@SESSION.sql_mode;


On your development server you can set it for the current session with

SET GLOBAL sql_mode = 'modes';
SET SESSION sql_mode = 'modes';