You’re importing some data into MySQL and using LOAD DATA INFILE so you can do a SHOW WARNINGS afterwards. Every line of your import file has a warning:
| Warning | 1262 | Row 1 was truncated; it contained more data than there were input columns
| Warning | 1262 | Row 2 was truncated; it contained more data than there were input columns
…etc.
The fix is easy, and you’d think of it eventually, but you thought you’d try google instead. So I’m posting this so that when you do there is something to find. There wasn’t much when I looked.
It’s the line endings. MySQL isn’t getting what it expects, so specify the format of the file using LINES TERMINATED BY ‘\r\n’ or whatever is appropriate for you:
‘\r\n’ for files that came from Windows systems
‘\r’ for files from VMS
‘\n’ for every other source.
Hope that helps.
I spent too much time trying to find out why MySQL didn’t recognize ‘\n’ as a new line.
So, I tried your suggestion ‘\r\n’ and it worked.
Thank you so much!
huges,
Carla.
Also spent long time for this stupid error. Thanks a lot for posting and explaining so easy.
Stefan