Incorrect column name "", 1166 during CSV import - mysql

I am trying to import a csv file into MySQL 5.6 using Workbench 6.3, using the Table Data Import wizard. I had a few issues with illegal characters which I fixed by doing a search and replace on the headers in excel, but now I am getting the following error -
DBError: ("Incorrect column name ''", 1166)
ERROR: Import data file: ("Incorrect column name ''", 1166)
When I am trying to import it, it seems like MySQL thinks there's a column where there isn't one -
This is what I suspect is causing the issue, but unchecking it doesn't help.
In the raw csv file, the headers column, it lookes like
...Quantity_Needed, Part_Number,.
Is it the last comma after Part_Number that is making MySQL do this? In the errors before it gave me the column name that was problematic but with this I don't know what to fix.
Edit: Fixed it. Tried re-exporting again without the second duplicate column from the get go instead of trying to fix it, and it worked. I'm thinking maybe there was some bad data in that column or something.

Related

Invalid column count in CSV input on line 1

I'm trying to import a CVS made from an excel file, but is not working, i'm receiving the following error -> Invalid column count in CSV input on line 1.
Follow the table structure
Follow the cvs file content
Do I need to have an id field in the csv file? Since its auto incremented, do i need to add it?
Follow is the import config of phpmyadmin
Another doubt, for each entry of mysql table, i would like to add an timestamp, is the configuration right? For every entry of the table, a timestamp will be added?
Regards

Invalid column count in CSV input on line 1 error (Already checked other questions)

So I've seen this question asked many times but I have not found an answer to my issue. I'm using phpmyadmin, I have 1 table with 2 columns and I have a .csv with 2 columns. My csv does not have headers and my columns are separated by ";", already changed it in phpmyadmin to "Columns separated with ;", but I still got the same error. Can anyone help?
edit: I'm using the "Import" option of phpMyAdmin to import my csv
edit2: So I decided to export my table to see how the csv was generated. It exports like this:
"1", "1001"
"2", "1002"
Do you know why? or how can I create an csv file with the same format?
export table
As it says in the manual
When importing data into a table from a CSV file where the table has an ‘auto_increment’ field, make the ‘auto_increment’ value for each record in the CSV field to be ‘0’ (zero). This allows the ‘auto_increment’ field to populate correctly.
see https://docs.phpmyadmin.net/en/latest/import_export.html
So, what worked for me was: I exported the table as an csv and worked over that. After I was done, I imported this modified csv and it worked. It must've been what nbk said about termination, so I guess in a way that was the answer

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
Database Fields
CSV Fields I want to import
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.

Cannot import csv into mysql database using phpmyadmin wizard

I am trying to import a csv file into my mysql database using phpmyadmin but keep getting errors.
Here is how the csv looks:
Then I import like this:
And get the error: "Invalid parameter for CSV import: Fields enclosed by". I have tried to put the columns in quotes " or put a semicolon after each column, but keep getting errors.
Yeah, you have an extra field in there. For instance, with your example line of:
itemId,date,description,amount
,1,2/13/2013,Fabrics,44
the date maps to "description" because of the leading comma, which basically gives an empty (or null, depending on how the import is handled) value to itemId, which doesn't seem to be what you want. Where'd that extra comma come from -- was this an export from some program?
Also, in this case you don't have anything enclosing the fields so you should just be able to leave that value empty, which seems to have worked for you once you got the column count corrected.
I had to remove the first line of the csv (containing the column names) and that solved the issue. Everything got imported properly.
Note, the date field needed reformatting to match SQL's date format yyyy-mm-dd.

MS Access Import from Text File problems

I'm trying to import a text file into an access database. It's not one I've written myself but the spec for the delimited text file is set up properly and the file imports properly using the wizard. When I try to use the import functions of the app itself, the ImportError table tells "Field Truncation" for one of the fields. Any help would be appreciated.
I would suggest examining each column that you're bringing in, and then measuring that against your table column properties in table "Design" mode.
Common things I've seen throw this error are:
Imported text exceeding the 255 character limit of a field (in which case you can change the field type to memo)
Date fields being set up as short date format, and then trying to import long dates/times into the field.
Text other than "yes/no/true/false" being imported into Yes/No/True/False fields.
Double-check your columns for similar names, and then check the data being imported. Sometimes when multiple people are working on a project and appending data, columns with similar names can get confused...especially if the column is collapsed so that its name is not entirely showing.