• 今天在执行 MySQL 插入数据时,发现报错了!
    Incorrect string value:
  • 报错
    Incorrect string value:

由于MySQL的默认编码格式为latin1,而我要将utf8的中文插入到数据库中。

查看数据表的编码
show create table employee;

Incorrect string value:

更改列的编码
alter table emp.department change dept_name dept_name varchar(50) character  set utf8;

Incorrect string value:
插入数据成功
Incorrect string value: