Skip to content

Instantly share code, notes, and snippets.

@flori
Last active May 17, 2022 14:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save flori/6897810 to your computer and use it in GitHub Desktop.
Save flori/6897810 to your computer and use it in GitHub Desktop.
(ffr@ffr:mysql [master] ❷ ->0)$ cat /usr/local/opt/mysql/my.cnf
[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION,ALLOW_INVALID_DATES
@slackmoehrle
Copy link

This doesn't work for me:

$ cat /usr/local/opt/mysql/my.cnf
[mysqld]
sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
SELECT STR_TO_DATE('10:00','%h:%i');

returns:

null

MySQL from brew...

@flori
Copy link
Author

flori commented May 17, 2022

This setting only applies to inserts and updates, see https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_no_zero_date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment