English 中文(简体)
MySQL Error: 无关联例外: ccii 代码c 可以在0级以下条件下通过0xef进行编码:
原标题:MySQL Error: Unhandled exception: ascii codec can t decode byte 0xef in position 0: ordinal not in range(128)

我下载了谷歌剧本,作为CSV文档,并试图将其作为我的SQL工作班桌上的一个桌子进口,但我却不断发现这一错误。

Unhandled exception: asciicodec can t decode byte 0xef in status 0: ordinal not in range (128)

I ve tried to export it/save it differently multiple times, but nothing has worked.

任何帮助都将受到高度赞赏。 谢谢!

最佳回答

The 0xEF value is the first byte of the byte order mark in the UTF-8 encoded CSV file you exported.

具体列明UTF-8文本编码,而不是ASCII在你进口档案时编码。

如果你无法具体说明哪些案文可加以使用,则在进口前将档案转换为ASCII。 你们可以与大多数现代文本编辑一道这样做,例如:.CotEditor for macOS,或 forWindows (see New document and Encoding

问题回答

一项工作只是将这种v/xls文档转换为JSON格式,然后可以通过工作流程进口。

如果有同样的问题。 Tried to import SPSS database into MySQL. 过于复杂。 Went through Excel -> .csv in order to have the utf-8 encoding. 还是没有工作。 下载的CtEditor很容易发现如何改变编码。 我的档案中约有8份,有BOM编码,这是MySQL接受的。 将其改为ut,这确实是trick。 这里的宏观用户。

Mysql Workbench 8.0.29+ has bug on "Table Data Import" feature.

参考:

Mysql Workbench在编码清单中只适用第1选项,尽管你选择了其他编码(utf8, etc)。

如果“第一种选择能够打上你的剪辑,那么Mysql Workbench就会放弃例外情况。

In my situation, my first option is cp950 and my CSV file is utf-8. Mysql Workbench throw exception and break. Even though I changed encoding to utf-8, Mysql Workbench still throw a cp950 exception.

我可以将我的特别安全等级转换为ASCII或CP950,因为我的数据不仅是ASCII/CP950的特性。

工作:

  1. Exit Mysql Workbench
  2. Open folder C:Program FilesMySQLMySQL Workbench 8.0 CEpythonlibencodings
  3. Backup the first option encoding python files in your list. (In my situation first option is cp950.py and cp950.pyc)
  4. Copy utf_8.py, utf_8.pyc and rename to cp950.py, cp950.pyc.
  5. Override original cp950.py, cp950.pyc in folder.
  6. Launches Mysql Workbench and Import again.

You can open the file with Microsoft Excel and save the file with the file format: Comma-separated Values (.csv). This method solved my problem. enter image description here

我有这个问题,在囚室一开始就变成了空地。 我的错误是:Acii 代码c 能够打上Axca的编码,处于125位:在范围(128)。

i simply went to position 125, then returned to my csv and found the space, deleted, and re-imported successfully.

For those trying to import non data that contains non-alphabetic characters (in my case it was Japanese). I post this link to this issue (it is in Japanese as well). The solution was simply:

  1. to run MySql Workbench from the command line
    open /Applications/MySQLWorkbench.app
  2. then Refresh all the schemas.

我也有同样的问题。 我向一位小编辑(你可以使用其他)开立了剪辑,然后在“我”上打开,由Encoding/UFT-8开放。 然后,我就能够用我的SQL进口。 我希望这能够帮助!

I had this same problem and I took all of the special characters out and still had that issue. I went to the excel file and it was saved as a .csv uft-8 file and I just changed it to a regular .csv and it worked.

use https://tableconvert.com/csv-to-json to convert the files into JSON and it will work





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签