When MySQL inserts Chinese into the table, it appears:incorrect string value error, because the character set does not support Chinese. The workaround is to change the character set to GBK, or UTF-8.
First, modify the default character set of the database
DEFAULT charcter SET character_name [COLLATE ...
Example:ALTER TABLEdb_mysql DEFAULT charcter SET GBK
notes:(Collate is a character set check, can be ignored when set, MySQL will be automatically set to the corresponding default value)
Second, modify the default character set of the table ALTER TABLE table_name DEFAULT CHARACTER SET character_name[COLLATE ...]
Example:ALTER TABLET_userDEFAULT CHARACTER SETGbk
Third,
Modify the morning character set for a field in a table ALTER TABLE table_name change Field field Field_type CHARACTER SET Character_na Me [COLLATE ...]
Example: ALTER TABLET_user ChangeWname WnameVARCHAR(20) CHARACTER SETGbk Four,
Modify the default character set for the table and the character set for all columns:
ALTER TABLE table_name CONVERT to CHARACTER SET character_name
Example:ALTER TABLE t_user CONVERT to CHARACTER SET GBK
When MySQL inserts Chinese into the table, it appears: incorrect string value error