Potential risks arising from modifying the default character set of a mysql TABLE if you need to modify the default character set of the TABLE after creating the TABLE, you can use alter table to modify the default character set of the TABLE. alter table tablename default character set utf8; but there is a problem, only the default encoding defined in the table is changed, and the existing fields in each column are still encoded in the past. The existing table data is not converted into encoding. Mysql> create table mybig5 (id int not null auto_increment primary key,-> subject varchar (100) engine = innodb default charset big5; Query OK, 0 rows affected (0.81 sec) mysql> show create table mybig5; + -------- + tables ------------------------------------- + | Table | Create Table | + -------- + Response ------------------------------- + | mybig5 | create table 'mybig5' ('id' int (11) not null AUTO_INCREMENT, 'subobject' varchar (100) default null, primary key ('id') ENGINE = InnoDB default charset = big5 | + -------- + ---------------------------------------------------- Rows + 1 row in set (0.00 sec) mysql> alter table mybig5 default charset utf8; Query OK, 0 rows affected (0.17 sec) Records: 0 Duplicates: 0 Warnings: 0 then we INSERT a multi-byte string record to the table mysql> insert into mybig5 VALUES (NULL, UNHEX ('e7bb8fe79086 '); 01:08:19 [INSERT-0 row (s ), 0.000 secs] [Error Code: 1366, S QL State: HY000] Incorrect string value: '\ xE7 \ xBB \ x8F \ xE7 \ x90 \ x86' for column 'subobject' at row 1... 1 statement (s) executed, 0 row (s) affected, exec/fetch time: 0.000/0.000 sec [0 successful, 0 warnings, 1 errors] mysql> show create table mybig5; + -------- + certificate ----------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------ + | Table | Create Table | + -------- + partition ratio + | mybig5 | create table 'mybig5' ('id' int (11) not null AUTO_INCREMENT, 'subobject' varchar (100) character set big5 default null, primary key ('Id ') ENGINE = InnoDB default charset = utf8 | + -------- + bytes ---------------------------------------------------- + 1 row in set (0.00 sec). We can see whether the column subject is big5 encoded, but not utf8. We can use 2. alter table tablename convert to character set utf8; TO modify the column encoding mysql> show create table mybig5; mysql> + -------- + response ------------------------------- +-> | Table | Create Table |-> + -------- + ignore tables +-> | mybig5 | create table 'mybig5' (-> 'id' int (11) not null AUTO_INCREMENT,-> 'subobject' varchar (100) default null,-> primary key ('id')->) ENGINE = InnoDB default charset = utf8 |-> + -------- + bytes ------------------------------------- +-> 1 row in set (0.00 sec), but pay attention to the conversion of existing content encoding, will not become garbled