Reprinted please indicate the source: http: blogcsdnnetouyida3articledetails46632215 this article is from: [ouyida3 blog] error description: MySQL [portaldb] INSERTINTOprod_productVALUES (5, 'ats ', '1',' error:
MySQL [portaldb]> insert into prod_product VALUES (5, 'ats ', '1', 'Eventually consistent thes', ", 'Eventually consistent thes', '1 ', '1', NULL, 'http: // 130.51.23.246: 20881/ipaas/ats/manage/create', NULL, NULL );
ERROR 1366 (HY000): Incorrect string value: '\ x80 \ xE7 \ xBB \ x88 \ xE4 \ xBA... 'For column' PROD _ name' at row 1
MySQL [portaldb]>
Read:
SQLyog v11.24 how to query Chinese garbled characters of MySQL5.6.24
In fact, it is still a problem with character sets. After MySQL is installed, it is set to gbk, and utf8 is used when I create a table.
MySQL [portaldb]> show create table prod_product;| prod_product | CREATE TABLE `prod_product` ( `PROD_ID` smallint(6) NOT NULL AUTO_INCREMENT, `PROD_EN_SIMP` varchar(20) COLLATE utf8_bin NOT NULL DEFAULT '', `PROD_TYPE` varchar(2) COLLATE utf8_bin NOT NULL, `PROD_NAME` varchar(60) COLLATE utf8_bin NOT NULL, `PROD_LOGOPIC_ID` varchar(10) COLLATE utf8_bin NOT NULL, `PROD_DESC` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', `PROD_VALID_FLAG` varchar(2) COLLATE utf8_bin NOT NULL DEFAULT '1', `PROD_SALE_FLAG` varchar(2) COLLATE utf8_bin NOT NULL DEFAULT '1', `PROD_PARAM` varchar(255) COLLATE utf8_bin DEFAULT NULL, `PROD_OPEN_RESTFULL` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '', `PROD_START_RESTFULL` varchar(255) COLLATE utf8_bin DEFAULT NULL, `PROD_STOP_RESTFULL` varchar(255) COLLATE utf8_bin DEFAULT NULL, `PROD_MDYPWD_RESTFULL` varchar(255) COLLATE utf8_bin DEFAULT NULL, `PROD_FULLCLEAR_RESTFULL` varchar(255) COLLATE utf8_bin DEFAULT NULL, `PROD_KEYCLEAR_RESTFULL` varchar(255) COLLATE utf8_bin DEFAULT NULL, `PROD_SELTEDKEY_RESTFULL` varchar(255) COLLATE utf8_bin DEFAULT NULL, `PROD_CANCLE_RESTFULL` varchar(255) COLLATE utf8_bin DEFAULT NULL, `PROD_USED_AMOUNT_RESTFULL` varchar(255) COLLATE utf8_bin DEFAULT NULL, PRIMARY KEY (`PROD_ID`)) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COLLATE=utf8_bin |
If you try to convert the table to utf8, insertion only reduces the number of errors (20 errors were inserted for 26, and 5 errors were reported after the change.
Finally, you need to set the character set to utf8 on the database server to solve the problem.
Summary:
If you want to support Chinese characters, you can still use utf8 in a unified manner. Although it is possible to use gbk, after all, the entire development, including javaee, is based on utf8.
2015.6.25