0

I'm in the beginning stages of trying to move some data from Google Sheets into a MySQL DB. I'm starting with one sheet that contains some user data. I save the sheet as a csv, then select that csv through MySQL Workbench's Table Import Wizard.

When I do, I receive the following error:

Unhandled exception: 'ascii' codec can't decode byte 0xc3 in position 178: ordinal not in range(128)

Some initial troubleshooting has revealed to me that I think the problem is a character in a name - a french user with the first name Aimée. Based on the error message, I've been trying to convert the google sheet data to utf-8 (as opposed to ASCII) before downloading as a csv, but everything I'm reading seems to say that simply downloading as a .csv should solve the problem.

Steps to reproduce:

  1. download Google Sheet as .csv
  2. Open MySQL Workbench and select existing table
  3. Select Table Data Import Wizard
  4. When prompted, select the .csv file I've just saved as the source file
  5. Select my existing table in the MySQL db as the destination table
  6. Click "Next", and receive error.
jarlh
  • 42,561
  • 8
  • 45
  • 63
  • 'Steps to reproduce:' - It would help if there was something to reproduce ie sample data and table definition. – P.Salmon Nov 03 '22 at 08:05

1 Answers1

0

There may be two errors here. Assuming you wanted an "acute-e", what you got was the utf8 encoding for such, hex C3A9. Then, because something was expecting ascii, it complained about the C3.

If you have an existing MySQL table, check the column's character set by doing SHOW CREATE TABLE. If the column does not have the charset, then the table's DEFAULT CHARACTER SET will take over. I suspect one of those is "ascii".

Change that to utf8mb4.

This may come in handy if you have further troubles: Trouble with UTF-8 characters; what I see is not what I stored

Rick James
  • 135,179
  • 13
  • 127
  • 222