查看当前Databases的编码:
use [databases name];
status;
数据库表中字段的字符集设置查看:
show create table [tables name];
show full columns from [tables name];
当前联接系统参数:
show variables like 'char%';
show variables like 'collation_%';
修改表中字段原有的字符集:
alter table [tables name] CONVERT TO CHARACTER SET utf8;
设置数据库编码:
在/etc/my.cnf里加入:
[mysqld]
default-character-set=utf8
...
[client]
default-character-set=utf8
最后:重启Mysql即可
use [databases name];
status;
数据库表中字段的字符集设置查看:
show create table [tables name];
show full columns from [tables name];
当前联接系统参数:
show variables like 'char%';
show variables like 'collation_%';
修改表中字段原有的字符集:
alter table [tables name] CONVERT TO CHARACTER SET utf8;
设置数据库编码:
在/etc/my.cnf里加入:
[mysqld]
default-character-set=utf8
...
[client]
default-character-set=utf8
最后:重启Mysql即可
本文介绍如何查看MySQL数据库的字符集设置,包括数据库、表字段及连接系统的字符集,并提供了修改字符集的方法。
344

被折叠的 条评论
为什么被折叠?



