What should I set DATE field as default value when NO_ZERO_DATE is enabled in MySQL? On shared hosting is not possible to change the NO_ZERO_DATE unless doing with a query but it seems more like a fast fix that the most correct one
Some of my tables has as default date &quot;0000-00-00&quot; what should be the correct setting when NO_ZERO_DATE is enabled? At this time I was thinking at a fixed date in the past like &quot;1900-01-01&quot; but not sure if is the most correct way to create the table
There is no date 0000-00-00 on any calendar. It's not a valid value for a date.
Don't use 0000-00-00 or 1900-01-01 or 9999-01-01 or any other supposedly &quot;unused&quot; date value to represent a missing value. This just trades one type of problem for some different problem. For example, you can no longer use MIN() or MAX() or AVG() on that column.
If you need some way to represent that the date is unknown or inapplicable on a given row, then use NULL. That's what NULL is for in SQL.