Computer Guy
asked on
MySQL 1262 Error
Hi,
I get this error when I import a CSV.
Warning (1262): Row 1 was truncated; it contained more data than there were input columns */
See attached screenshot for row 1
See attached screenshot of my Structure
Also, what is the best collation to use?
Row-1.png
Structure.png
I get this error when I import a CSV.
Warning (1262): Row 1 was truncated; it contained more data than there were input columns */
See attached screenshot for row 1
See attached screenshot of my Structure
Also, what is the best collation to use?
Row-1.png
Structure.png
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I wonder if the AUTO_INCREMENT column is throwing you off.
Does it work if there is an ID in front of each.
1,text,text,text
Test that. If so you somehow need to ignore the first field. Some one on the web suggested putting @dummy as field 1 so it will get ignored. I haven't tried that.
Or if you do it my way from the TSQL line and name your fields, skipping the ID field (field 1) it may work that way.
Does it work if there is an ID in front of each.
1,text,text,text
Test that. If so you somehow need to ignore the first field. Some one on the web suggested putting @dummy as field 1 so it will get ignored. I haven't tried that.
Or if you do it my way from the TSQL line and name your fields, skipping the ID field (field 1) it may work that way.
Do you have PHP available? If so, PHP can read the CSV file into an array with fgetcsv(), allowing for a variety of field delimiters. The PHP code to take these arrays and create INSERT queries is pretty standard stuff.
ASKER
See screen shot of how I import it.
data.png