Link to home
Start Free TrialLog in
Avatar of Computer Guy
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
ASKER CERTIFIED SOLUTION
Avatar of SStory
SStory
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Computer Guy
Computer Guy

ASKER

Enya,A Day Without Rain,Processional Songs

See screen shot of how I import it.
data.png
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.
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.