error 1265. Data truncated for column when trying to load data from txt file

后端 未结 8 2545
萌比男神i
萌比男神i 2020-12-18 18:52

I have table in mysql table table looks like

create table Pickup
(
PickupID int not null,
ClientID int not null,
PickupDate date not null,
PickupProxy  va         


        
8条回答
  •  遥遥无期
    2020-12-18 19:09

    The reason is that mysql expecting end of the row symbol in the text file after last specified column, and this symbol is char(10) or '\n'. Depends on operation system where text file created or if you created your text file yourself, it can be other combination (Windows uses '\r\n' (chr(13)+chr(10)) as rows separator). Thus, if you use Windows generated text file, add following suffix to your LOAD command: “ LINES TERMINATED BY '\r\n' ”. Otherwise, check how rows are separated in your text file. On default mysql expecting char(10) as rows separator.

提交回复
热议问题