Invalid default value for 'media_udate'

Netsvetaev / 2017-01-13 21:10:02   

After upgrade to Ubuntu 16.04 with php7 I have an error "Invalid default value for 'media_udate'" on installation step 2. Server is "localhost", mysql user and password are correct.

Vaska A / 2017-01-13 21:19:06   

Wonderful...

This is a mysql issue with how it's setup.

"That is because of server SQL Mode - NO_ZERO_DATE.

From the reference: NO_ZERO_DATE - In strict mode, don't allow '0000-00-00' as a valid date. You can still insert zero dates with the IGNORE option. When not in strict mode, the date is accepted but a warning is generated."

The only way I can deal with this is to hire somebody to figure out a way around it. I don't have a solution for you today...

Vaska A / 2017-01-13 21:27:58   

Is this on Digital Ocean? I don't know if it's really on me to resolve this...can't you adjust your server setup?

This is pretty difficult...

Netsvetaev / 2017-01-15 18:37:02   

Don’t worry about that. I know, it’s difficult to maintain web software for all configurations in the world :-)

  1. So, all I need is change sql mode like this:
  2. SET GLOBAL sql_mode = 'no_zero_date';
  3. SET SESSION sql_mode = 'no_zero_date';

And it works!

Vaska A / 2017-01-15 18:48:50   

I'm so happy to hear this!

This thread has been closed, thank you.