Whitena
Whitena

Reputation: 51

Importing CSV data into a table in mySQL database

Ok so I am trying to import data from a CSV file into mySQL database table. The table is called serial_code, however when I try to upload the CSV file I have an error message. I have tried taking the column names out, also adding NULL to the last column EngineSerialCode and I have also viewed the CSV in a text editor and it shows the columns correctly with , comma.

Invalid column count in CSV input on line 1.

Version of phpMyAdmin and mySQL

mySQL version

Database Fields

enter image description here

CSV Fields I want to import

CSV

Upvotes: 2

Views: 139

Answers (1)

Whitena
Whitena

Reputation: 51

Ok so I found the issue and it was quite frustrating. I had a serial code in my data that had a "," comma instead of a "-". Also I noticed that my CSV file EngineSerialCode was placed in column E and not D as I only have 4 columns in my database. From the image column C is overlapping column D hence my mistake.

comma and wrong column error

Upvotes: 1

Related Questions