MySQLが一部の中国語文字を挿入したエラーの問題を解決する方法

2261 ワード

Winformプログラム、追加機能、保存を行う場合、システムは異常情報を与える"Incorrect string value:'xACQxCExC 4xD 7xAA...'for column'TaskDes'at rows問題原因:文字セットの設定が一致していないため、解決方法:クライアント、サーバー、データベース、テーブル、フィールドの文字セットを一致に設定する必要があります.
[client]
port=3306
default-character-set=utf8 [mysql] default-character-set=utf8 character_set_server=utf8 # SERVER SECTION # ------------------------------------------------------------- # The following options will be read by the MySQL Server. Make sure that # you have installed the server correctly (see above) so it reads this # file. # [mysqld] # The TCP/IP Port the MySQL Server will listen on port=3306 #Path to installation directory. All paths are usually resolved relative to this. basedir="D:/Program Files/MySQL/MySQL Server 5.5/" #Path to the database root datadir="C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.5/Data/" # The default character set that will be used when a new schema or table is # created and no character set is defined character_set_server=utf8

2、データベースの文字セットを変更する:SET character_set_database=utf8; 3、修正表の文字セット:ALTER TABLE表名CONVERT TO CHARACTER SET utf 8;