I want to configure a MySQL db instance not to accept zero dates(0000-00-00 00:00:00) because the software running on top of it fails to run if it encounters such a field.
The server is running MySQL version 5.5.40.
I added the following lines in the my.cnf file, in the [mysqld] section:
sql-mode="NO_ZERO_DATE,NO_ZERO_IN_DATE"
innodb_strict_mode="ON"
After a restart, if I check from the command line I get the following:
mysql> SELECT @@GLOBAL.sql_mode;
+------------------------------+
| @@GLOBAL.sql_mode |
+------------------------------+
| NO_ZERO_IN_DATE,NO_ZERO_DATE |
+------------------------------+
1 row in set (0.00 sec)
mysql> SELECT @@GLOBAL.innodb_strict_mode;
+-----------------------------+
| @@GLOBAL.innodb_strict_mode |
+-----------------------------+
| 1 |
+-----------------------------+
1 row in set (0.00 sec)
But if I connect with a client app to the database and try to fill in a zero date, it still works. I tried to recreate the database, still no luck. Any ideas why this is?
Thank you.
INSERT IGNORE
?innodb_strict_mode=0
for its own session..