1.查看指定库的字符集
SHOW CREATE DATABASE learn;
修改库的字符集
1.alter database 库名 default character set 字符集; 2.alter database learn character set utf8
2.查看表中每个字段的字符集
show full fields from table_name;
修改表中编码为utf8,表中的字符类型字段会自动跟随表的编码
alter table table_name convert to character set utf8;
3.查看表的编码
show table status from learn like "students";