mysql字符集修改(ubuntu)
1.关闭mysql服务
/etc/init.d/mysql start|stop
2.在/etc/mysql/my.cnf,添加下列信息
[client]
default-character-set=utf8
[mysqld]
character-set-server=utf8
[mysql]
default-character-set=utf8
3.修改表的字符集
alter table tableName convert to character set utf8 collate utf8_general_ci;
4.修改字段字符集
alter table tableName change columnName columnName columnType character set utf8 collate utf8_general_ci;
5.查看各项编码
show variables like '%character%';
show full columns from tableName;