What are the disadvantages of turning MySQL strict mode off?
I've ran into an issue which can be easily solved by turning off the "strict" mode in MySQL. I'm however not in favor of turning it off just to have my query work.
Can someone inform me what are the disadvantages of disabling the strict mode? If I'm sanitizing all the data being sent to the DB; should I still care about the strict mode?
Thank you in advance.Posted in: #Databases
Strict mode works exactly how it sounds.
As per my experience with mysql..
With strict mode off.. if you try to insert the long data compared to what the max length is defined..mysql will convert it to column datatype and truncate the value to max allowed limit. It means, you will not get an error. However with strict mode, data will not be inserted and error will be thrown.
Another example is datetime column being not null will not allow you to insert record without a valid value if strict mode is ON. With mode off, it will automatically insert the zero datetime value like 0000-00-00 00:00:00
More info here..