Re: '0000-00-00' is an invalid date

From: Peter H. Coffin <hellsop_at_ninehells.com>
Date: Sun, 4 Feb 2018 20:52:42 -0600
Message-ID: <slrnp7fhnq.d0s.hellsop_at_nibelheim.ninehells.com>


[Quoted] [Quoted] On Sun, 4 Feb 2018 15:27:40 -0500, bill wrote:

> On 2/4/2018 10:52 AM, Peter H. Coffin wrote:
>
>> Two routes:
>>
>> a) Turn zero dates on in your SQL Mode then turn them back off again
>> when you've fixed this. (If you want them off -- leaving them on will
>> PROBABLY get you the behavior you were expecting in the beginning.
>> But it's your database, so you're the one that has to live with any
>> unexpected consequences of a permanent mode change now.)
>
> It appears that in the OS upgrade I went from 5.5.59 to 5.7.21 which
> changed the mode so that NO_ZERO_DATE AND NO_ZERO_IN_DATE were set.
>
> As you suggested I want to set the mode to turn off NO_ZERO_DATE, but
> can't see how. doing SET GLOBAL sql_mode ='' would probably cause lots
> of changes I don't want. How does one set just one mode off?

[Quoted] [Quoted] All that stuff, what the defaults are, how to turn the stuff on and off dynamically while the server is running, how to determine what modes are at in effect at the time are all at the top of the reference manual pages for 5.7. The suggestion I made to read through that whole section wasn't just me being snarky; it actually contains the information you needed to go down the path.

https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html

-- 
16. I will never utter the sentence "But before I kill you, there's 
   just one thing I want to know."
        --Peter Anspach's list of things to do as an Evil Overlord
Received on Mon Feb 05 2018 - 03:52:42 CET

Original text of this message