mysql编码问题Incorrect string value: '\xE7\xA8\x8B\xE5\xBA\x8F...' for column '******' at row 1

The reason is because the problem encoding your database is not utf-8, then when you build the table did not specify the default encoding is utf-8 table

Solution 1: If the operation object data stored by throwing an exception when you save

1. Deletion of the table, with ENGINE = InnoDB DEFAULT CHARSET = utf8 words, for example:

drop TABLE table name CASCADE;
the CREATE TABLE table name ( the serialNo VARCHAR (50) the COMMENT 'serial number', pdesc the TEXT the COMMENT 'text', EDSInputtime VARCHAR (20 is) the COMMENT 'timespan'



) ENGINE = the InnoDB the DEFAULT the CHARSET = UTF8 the COMMENT = 'Detail'; 

2. If you can not delete the table, direct execution

alter table cb_arbitration engine=innodb;  
alter table cb_arbitration CHARSET=utf8;

or

ALTER TABLE `表名` DEFAULT CHARACTER SET utf8;

Solution 2: If the abnormality patterning saved, will be changed to the appropriate column to utf8-utf8_general_ci


Guess you like

Origin blog.csdn.net/John_Kry/article/details/81001004