mysql table import wizard fails to import a csv file

42,389

Solution 1

There are 3 csv

While you are saving the excel data using "Save as" option select msdos .csv format. Note that there are 3 csv format out of it select only MS-DOS .csv as highlighted in image.

Solution 2

I tried every CSV format there was with no luck. In the end I found that selecting this option worked with a file saved as CSV (MS-DOS) (*.csv):

enter image description here

Solution 3

Using import Button tool in the SQL result. See the image

Sử dụng công cụ import trên cửa sổ câu lệnh SQL.

Solution 4

I found this solution and it works for me

The problem is UTF-8 encoding

In excel sometimes it usually fails when saving, what can be used is Google Drive.

1.- Create a Drive Spreadsheet

2.- Import your .csv document

3.- Go to File-> Download as-> csv

And that's it, it should work because it was encoded back to utf-8.

Share:
42,389
user1907514
Author by

user1907514

Updated on July 09, 2022

Comments

  • user1907514
    user1907514 almost 2 years

    I am trying to import a csv file (Window 10), created by notepad++, using semicolons as delimiters, extension .csv.

    I use Mysql Workbench 6.3, import wizard. Encode in notepad++ is UTF-8, and the mysql table I am trying to load is utf-8 default collation

    Import wizard fails to import and shows two messages: Table data Import: Can't analyze the file, please try to change encoding type. If that doesn't help, maybe the file is no: csv, or the file is empty

    Unhandled exception: 'ascii' codec can't encode character u'\xfa' in position 1: ordinal not in range (128)

    How can I do to trace this error. I tried several encodings for the file, but the error persists.

    thanks

  • user1907514
    user1907514 over 8 years
    thanks, I used excel to export a csv utf-8 file. Import process keeps failing
  • Rick James
    Rick James over 8 years
    "failing" = aborting? truncating? garbage characters? question marks? nothing?
  • Neil Monroe
    Neil Monroe over 2 years
    Even though this is not a great process and does not really determine the issue, this was the only method that worked in my situation.