MySQL Incorrect datetime value: '0000-00-00 00:00:00'

后端 未结 19 1048
没有蜡笔的小新
没有蜡笔的小新 2020-11-29 15:51

I\'ve recently taken over an old project that was created 10 years ago. It uses MySQL 5.1.

Among other things, I need to change the default character set from latin1

19条回答
  •  我在风中等你
    2020-11-29 16:52

    Instead of

    UPDATE your_table SET your_column = new_valid_value where your_column = '0000-00-00 00:00:00';
    

    Use

    UPDATE your_table SET your_column = new_valid_value where your_column = 0;
    

提交回复
热议问题