1292: Incorrect datetime value: '' for column at row 1

后端 未结 3 1525
慢半拍i
慢半拍i 2020-12-20 21:33

I am trying to load data from excel sheet to the below table on MYSQL 5.6 on windows 8.1 and I am getting \'Incorrect datetime value:\' error.

Term date column is o

相关标签:
3条回答
  • 2020-12-20 22:08

    In MySQL, '' (an empty string) is different from a null. If you want a null value, you should use an explicit null:

    INSERT INTO `mith`.`EMPLOYEE` 
    (`EMP_ID`, `EMP_NAME`, `SALARY`, `START_DATE`, `TERM_DATE`)
    VALUES ('26', 'Will Banker', '90000', '00:00.0', null)
    
    0 讨论(0)
  • 2020-12-20 22:14

    I managed to solve a similar problem using the commands:

    mysql> set session sql_mode='';
    

    and

    mysql> set global sql_mode='';
    

    in mysql prompt.

    0 讨论(0)
  • 2020-12-20 22:22

    Try replacing the null values in Excel with 0000-00-00. I have not tried this with Excel, but it works for csv file. import

    0 讨论(0)
提交回复
热议问题