ncorrect string value: '\xE5\xBC\xA0\xE6\x97\xA0...' for column 'name' at row 1
这个错误的原因就是数据库的默认编码格式为latin1,而你要将utf-8的中文插入到表中。
然后就将表的格式改为utf-8。
使用指令为:alter table stu character set utf8;
而此时表中数据的格式还是latin1,因此还要将表中出错数据的格式换为utf8
使用指令为:alter table stu change name name varchar(50) character set utf8;
大家只需要更改数据库相关数据信息就可以啦!