我正在尝试使用 InnoDB 引擎将数据从文件插入到 MYSQL 8.0。
我正在使用这个查询:
LOAD DATA INFILE '/var/lib/mysql-files/item_new_1_4.dat'
INTO TABLE Item FIELDS TERMINATED BY '|';
我收到一条错误消息:
ERROR 1292 (22007) at line 1: Incorrect date value: 'NULL' for column 'i_rec_end_date' at row 1
该表是由该查询创建的:
CREATE TABLE IF NOT EXISTS Item(
i_item_sk integer ,
i_item_id char(16) NOT NULL,
i_rec_start_date date,
i_rec_end_date date,
i_item_desc varchar(200),
i_current_price decimal(7,2),
i_wholesale_cost decimal (7,2),
i_brand_id integer,
i_brand char(50),
i_class_id integer default ,
i_class char(50),
i_category_id integer,
i_category char(50),
i_manufact_id integer,
i_manufact char(50),
i_size char(20),
i_formulation char(20),
i_color char(20),
i_units char(10),
i_container char(10),
i_manager_id integer,
i_product_name char(50),
PRIMARY KEY (i_item_sk)
);
第1行的数据是:
1|AAAAAAAABAAAAAAA|1997-10-27|NULL|Powers will not get influences. Electoral ports should show low, annual chains. Now young visitors may pose now however final pages. Bitterly right children suit increasing, leading el|27.02|23.23|5003002|exportischolar #2|3|pop|5|Music|52|ableanti|N/A|3663peru009490160959|spring|Tsp|Unknown|6|ought|