skip to Main Content

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?

table structure

csv file

edit: I’m using the "Import" option of phpMyAdmin to import my csv

importing 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

3

Answers


  1. Chosen as BEST ANSWER

    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


  2. 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

    Login or Signup to reply.
  3. I had the same issue and discovered I was importing a csv table file into the wrong existing table in phpmyadmin. The number of columns was not the same, which is why I believe the error happened. Once I selected the right table, THEN clicked Import, I was able to upload successfully.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search