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
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.
I had same problem. I wanted to edit ENUM values in table structure. Problem was because of rows that was saved before and new ENUM values doesn't contain saved values.
Solution was updating old saved rows in MySql table.
I have met this problem with a column that has ENUM values('0','1').
When I was trying to save a new record, I was assigning value 0 for the ENUM variable.
For the solution: I have changed ENUM variable value from 0 to 1, and 1 to 2.
I had this issue when trying to convert an existing varchar
column to enum
. For me the issue was that there were existing values for that column that were not part of the enum
's list of accepted values. So if your enum
will only allow values, say ('dog', 'cat')
but there is a row with bird
in your table, the MODIFY COLUMN
will fail with this error.
This error can also be the result of not having the line,
FIELDS SPECIFIED BY ','
(if you're using commas to separate the fields) in your MySQL syntax, as described in this page of the MySQL docs.
You're missing FIELDS TERMINATED BY ','
and it's assuming you're delimiting by tabs by default.