1

I'm trying to run the following script in MySQL Workbench:

UPDATE `people` SET `dateDied` = '0000-00-00';

And I get this error:

Error Code: 1292. Incorrect date value: '0000-00-00' for column 'dateDied' at row 1

Now I have already disabled strict mode in the my.ini that MySQL Workbench is set to use

sql_mode = ""

I did a scan for any my.ini in my drive where MySQL is installed and that is the only one I see that exists. I have a Laravel application running with strict mode off just fine but for whatever reason MySQL Workbench is giving me that error and I don't know why. It's almost like its ignoring that value. I have restarted MySQL and MySQL Workbench several times but cannot get that script to run successfully.

What am I missing?

Slava Rozhnev
  • 9,510
  • 6
  • 23
  • 39
Jason Ayer
  • 621
  • 1
  • 10
  • 20
  • You should have a look here : https://stackoverflow.com/questions/36374335/error-in-mysql-when-setting-default-value-for-date-or-datetime/36374690#36374690 – Patrice G Jul 01 '20 at 14:56
  • You're trying to set the system-wide value. Assuming you succeed (not sure if you verify that) the application can still set a different session value and override server's default. – Álvaro González Jul 01 '20 at 15:00
  • Does this answer your question? [1292: Incorrect datetime value: '' for column 'TERM\_DATE' at row 1](https://stackoverflow.com/questions/28530195/1292-incorrect-datetime-value-for-column-term-date-at-row-1) – Slava Rozhnev Jul 08 '20 at 14:44

1 Answers1

1

Running MySQL Workbench as Administrator and running this query resolved it for me:

SET GLOBAL sql_mode = '';

For some reason updating the my.ini with the following did not take care of it.

sql_mode = ''
Jason Ayer
  • 621
  • 1
  • 10
  • 20