Encoding settings database tables and fields

 

1. Set code database table

 

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

 

After setting the coding table, using show create table name; query encoding format.

 

You may find that the encoding format columns in the table still has not changed, it is necessary to change the encoding format of the column.

 

 

2. The setting table of the encoding format field

 

--- alter table change table name field name field name field type data character set utf8;

 

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

 

Guess you like

Origin www.cnblogs.com/zdcn/p/11243353.html