1. 设定数据库字符集为utf8,名称为mydb1
create database mydb1 default character set utf8 collate utf8_general_ci;
2. 设定数据库字符集为utf8mb4,名称为mydb2(个人推荐选择utf8mb4_unicode_ci)
create database mydb2 default character set utf8mb4 collate utf8mb4_unicode_ci;
或者
create database mydb2 default character set utf8mb4 collate utf8mb4_general_ci;
修改用alter
3. 设定数据库字符集为gbk,名称为mydb2
create database mydb3 default character set gbk collate gbk_chinese_ci;
4. 更改数据库的字符编码
ALTER DATABASE db_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
5. 参考
http://t.csdnimg.cn/G1fTh
http://t.csdnimg.cn/LnliH