mysql设置编码为UTF8,设置表为UTF8。

1.设置编码为UTF-8

set character_set_client = utf8;

set character_set_server = utf8;

set character_set_connection = utf8;

set character_set_database = utf8;

set character_set_results = utf8;

set collation_connection = utf8_general_ci;

set collation_database = utf8_general_ci;

set collation_server = utf8_general_ci;

 

 

2.设置表为UTF-8

alter table tb_anniversary convert to character set utf8;

  

3.另外新建数据库时,设置库为UTF-8

create database app_relation character set utf8; 

 

 

你可能感兴趣的:(mysql设置编码为UTF8,设置表为UTF8。)