MySQL插入中文,提示 SQL 错误 [1366] [HY000]: Incorrect string value: ‘\xE5\xBC\xA0\xE4\xB8\x89‘ for column ‘n
修改那个字段的编码为uft8
建表语句
CREATE TABLE total_data_waijian(
id int,
name
varchar(25) ,
email varchar(25) NOT NULL,
age int
);
修改编码
alter table total_data_waijian change name name varchar(255) character set utf8;
插入数据插入成功
INSERT into total_data_waijian(id,name,email,age)value(1,“黄芪”,“xiao@qq.com”,16);