1.设置数据库表的编码

 

---alter table 表名 default character set utf8;

 

在设置完表的编码后,使用 show create table 表名;查询编码格式。

 

可能你会发现表中列的编码格式仍然没有发生改变,因此需要改变列的编码格式。

 

 

2.设置表中字段的编码格式

 

---alter table 表名 change 字段名 字段名 字段的数据类型 character set utf8;

 

eg.alter table product change cid cid VARCHAR(50) character set utf8;

 

相关文章:

  • 2022-02-01
  • 2021-07-14
  • 2021-10-16
  • 2022-12-23
  • 2021-09-23
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
相关资源
相似解决方案