mysql 设置字符集
可以用:show create table table_name查看建表信息
也可用: show create database database_name查看建库信息
mysql> create table abc(id int)charset=gbk; Query OK, 0 rows affected (0.04 sec) mysql> create table abc(id int)default charset=gbk; ERROR 1050 (42S01): Table 'abc' already exists mysql> create table abc1(id int)default charset=gbk; Query OK, 0 rows affected (0.03 sec) mysql> show create table abc; +-------+----------------------------------------------------------------------- ---------------+ | Table | Create Table | +-------+----------------------------------------------------------------------- ---------------+ | abc | CREATE TABLE `abc` ( `id` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=gbk | +-------+----------------------------------------------------------------------- ---------------+ 1 row in set (0.00 sec) mysql> show create table abc1; +-------+----------------------------------------------------------------------- ----------------+ | Table | Create Table | +-------+----------------------------------------------------------------------- ----------------+ | abc1 | CREATE TABLE `abc1` ( `id` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=gbk | +-------+----------------------------------------------------------------------- ----------------+ 1 row in set (0.00 sec) mysql>