skip to Main Content

Returned the following error on mysql when importing the data:

  • Row import failed with error: ("Incorrect date value: ’18-02-1962′ for column ‘birthdate’ at row 1", 1292)
  • Row import failed with error: ("Incorrect date value: ’08-12-1958′ for column ‘birthdate’ at row 1", 1292)
  • Row import failed with error: ("Incorrect date value: ’29-08-1973′ for column ‘birthdate’ at row 1", 1292)
  • Row import failed with error: ("Incorrect date value: ’19-09-1947′ for column ‘birthdate’ at row 1", 1292)
  • Row import failed with error: ("Incorrect date value: ’03-03-1965′ for column ‘birthdate’ at row 1", 1292)
  • Row import failed with error: ("Incorrect date value: ’01-07-1973′ for column ‘birthdate’ at row 1", 1292)
  • Row import failed with error: ("Incorrect date value: ’29-05-1970′ for column ‘birthdate’ at row 1", 1292)
  • Row import failed with error: ("Incorrect date value: ’09-01-1968′ for column ‘birthdate’ at row 1", 1292)
  • Row import failed with error: ("Incorrect integer value: ” for column ‘reports_to’ at row 1", 1366)

The following is the code used to create table:

CREATE TABLE employee (
employee_id INT PRIMARY KEY,
last_name VARCHAR(50) NOT NULL,
first_name VARCHAR(50) NOT NULL,
title VARCHAR(50) NOT NULL,
reports_to INT NULL,
birthdate DATETIME,
hire_date DATETIME,
address varchar(50) NOT NULL,
city varchar(50) NOT NULL,
state varchar(50) NOT NULL,
country varchar(50) NOT NULL,
postal_code varchar(15) NOT NULL,
phone varchar(50) NOT NULL,
fax varchar(50) NOT NULL, 
email varchar(50) NOT NULL
);

No idea why this error occured!

2

Answers


  1. MySQL Date Data Types
    MySQL comes with the following data types for storing a date or a date/time value in the database:

    DATE - format YYYY-MM-DD
    DATETIME - format: YYYY-MM-DD HH:MI:SS
    TIMESTAMP - format: YYYY-MM-DD HH:MI:SS
    YEAR - format YYYY or YY
    

    If the table column is in data type is DATE then data should be in YYYY-MM-DD format

    refer https://www.w3schools.com/mysql/mysql_dates.asp

    Login or Signup to reply.
  2. the datatype for birthdate is DATETIME which is literally date + time. you are providing the wrong input.
    you probably want to change the datatype to DATE

    you can refer to this:
    https://dev.mysql.com/doc/refman/8.0/en/datetime.html

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search