Incorrect string value: '\xE5\xBC\xA0\xE6\x97\xA0...' for column 'name' at row 1
这个错误的原因就是数据库的默认编码格式为latin1,而你要将utf8的中文插入到表中。
然后就将表的格式改为utf8。
使用指令为:alter table stu character set utf8;
但修改后发现还是不能将数据添加到表中
想了下是因为表中数据的格式还是latin1,因此还要将表中出错数据的格式换为utf8
使用指令为:alter table stu change name name varchar(50) character set utf8;
然后再重新添加数据就好了。