MySQL ERROR 1366(HY000):Incorrect string value:''for column''at row 1解決方案
1) Linux 更改檔案編碼
[root@lottery ~]# file db_patch.sql --檢視檔案字符集編碼
db_patch.sql: ISO-8859 text, with very long lines, with CRLF line terminators
[root@lottery ~]# iconv -f ISO-8859-1 -t UTF-8 db_patch.sql > db_patch1.sql --更改檔案字符集另存為一個新檔案
引數介紹:
-f, --from-code=名稱 原始文字編碼
-t, --to-code=名稱 輸出編碼
-l,--list 列舉所有已知的字符集
心細的人可能會發現 -f後是 ISO-8859-1 而非fille 看到的 ISO-8859編碼
那是因為執行 iconv -f ISO-8859 -t UTF-8 db_patch.sql > db_patch1.sql
報錯資訊: iconv: 不支援以“ISO-8859”為源頭的轉換
試用“iconv --help”或“iconv --usage”以獲取更多資訊。
[root@lottery ~ ]# iconv -l|grep ISO-8859 --列一下iso-8859編碼號資訊
ISO-8859-1//
ISO-8859-2//
ISO-8859-3//
ISO-8859-4//
ISO-8859-5//
ISO-8859-6//
ISO-8859-7//
ISO-8859-8//
ISO-8859-9//
ISO-8859-9E//
ISO-8859-10//
ISO-8859-11//
ISO-8859-13//
ISO-8859-14//
ISO-8859-15//
ISO-8859-16//
[root@lottery ~ ]# 所以隨意找一個ISO-8859-1// 進行轉換即可..
轉換後的字符集檢視
[root@lottery ~]# file db_patch1.sql
db_patch1.sql: UTF-8 Unicode text,with very long lines, with CRLF line terminators
[root@lottery ~]#
mysql> source db_patch1.sql;
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql>
2)Windows上更改檔案編碼 ,開啟檔案 另存為時下端編碼部分設定utf-8
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28602568/viewspace-1651067/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- mysql 報錯:ERROR 1366 (HY000): Incorrect string value: ‘\xD5\xC5\xC8\xFD‘ for column ‘name‘ at row 1MySqlError
- 【MySQL報錯】1366 - Incorrect string value: ‘\xE6\x80\xBB\xE7\xBB\x8F...‘ for column ‘name‘ at row 1MySql
- 解決:java.sql.SQLException: Incorrect string value: ‘\xF0\x9F\x92\x94‘ for columnJavaSQLException
- PHP連線SQL資料庫無法顯示emoji表情的解決辦法(變成問號、1366 Incorrect string value)PHPSQL資料庫
- java.sql.SQLException: Incorrect string valueJavaSQLException
- 【BUG記錄】MySQL插入Emoji表情報錯"Incorrect string value"MySql
- MySQL案例02:ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGESMySqlError
- mysql Unknown column ‘‘ in ‘field list‘解決方案MySql
- MySQL: Incorrect string value: '\xF0\xA4\xBD\x82'分析MySql
- 解決一個小坑:error on line 1 at column 1: Document is emptyError
- Flutter 之 Row、Column詳解Flutter
- Convert DataFrame string complex i to j python // “Cloning” row or column vectorsPython
- pymysql.err.OperationalError: (1136, “Column count doesn‘t match value count at row 1“)報錯反省。MySqlError
- MySQL 5.7 建立使用者報錯 ERROR 1805 (HY000): Column count of mysql.user is wrongMySqlError
- ERROR 1290 (HY000) 解決辦法Error
- Flutter之Row/Column用法詳解Flutter
- 【問題解決】remote: parse error: Invalid numeric literal at line 1, column 20,解決思路REMError
- Flutter 佈局(七)- Row、Column詳解Flutter
- 解決ERROR 1030 (HY000): Got error 168 from storage engine apparmorErrorGoAPP
- ERROR 1290 (HY000): The MySQL server is running withErrorMySqlServer
- 解決 Incorrect datetime value: '0000-00-00 00:00:00' 報錯
- mysql Index column size too large 超過767錯誤解決方案(轉)MySqlIndex
- Mysql連線錯誤ERROR 2003 (HY000)MySqlError
- Mysql 報Row size too large 65535解決方法MySql
- Flutter基礎元件Row&ColumnFlutter元件
- 【MySQL】ERROR 1878 (HY000): Temporary file write failure.MySqlErrorAI
- MySQL報錯ERROR 2013 (HY000): Lost connection to MySQL server during queryMySqlErrorServer
- JSON parse error: Cannot deserialize value of type `java.time.LocalDateTime` from StringJSONErrorJavaLDA
- [20231103]sqlplus column new_value old_value.txtSQL
- [20230303]sqlplus column new_value old_value.txtSQL
- ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization paErrorMySqlServer
- Flutter線性佈局Row和ColumnFlutter
- Flutter控制元件--Row、Column和StackFlutter控制元件
- ERROR 2026 (HY000): SSL connection error: unknown error numberError
- Mysql:Variable 'XXXt' can't be set to the value of 'NULL'解決MySqlNull
- MySQL 報錯 ERROR 1290 (HY000): running with the --secure-file-privMySqlError
- ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables optErrorMySqlServer
- 阿里雲mysql遠端登入報ERROR 2027(HY000)阿里MySqlError
- Error: error:0308010C:digital envelope routines::unsupported 解決方案ErrorGit