SQL Error #1366 when importing

samurai posted 4 years ago in Import/Export
I have a table created with:

id                  SERIAL,
name                TEXT NOT NULL

Then when I try to import a TSV file, the first few lines are...(id and name are separated by \t)
1	Barsotti, Marcel
2	Isamar Compania
3	Tradia

When I try to import via it gives me an error:
SQL Error (1366): Incorrect integer value: '1' for column 'id' at row 1

I have the import options configured as:
Fields terminated by \t
Lines terminated by \n
(I left the other two options blank)

Curiously I didn't have a problem with another table with the exact same id type

I've also tried changing the id type to INT instead of BIGINT
samurai posted 4 years ago
I ran this in SQLyog and it showed the same error as a warning but then completed the import but set the id for first row to 0 next one to 2 then 3 and so on. So I know the problem is only with the id value of the first line.
kalvaro posted 4 years ago
It's possible that you saved the file as UTF-8 with BOM. If that's the case, just change your editor settings to omit the BOM (it isn't mandatory and most apps cannot handle it).

Please login to leave a reply, or register at first.