mysql table import wizard fails to import a csv file
Solution 1
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)
:
Solution 3
Using import Button tool in the SQL result. See the image
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.
user1907514
Updated on July 09, 2022Comments
-
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 over 8 yearsthanks, I used excel to export a csv utf-8 file. Import process keeps failing
-
Rick James over 8 years"failing" = aborting? truncating? garbage characters? question marks? nothing?
-
Neil Monroe over 2 yearsEven though this is not a great process and does not really determine the issue, this was the only method that worked in my situation.