现在的位置: 首页 > 综合 > 正文

如何更改mysql编码

2013年08月30日 ⁄ 综合 ⁄ 共 242字 ⁄ 字号 评论关闭

1.

在创建数据表时将默认编码改为gb2312
如:mysql> create table student(id int(3) auto_increment not null primary key, sed char(8),sex char(2),csny date) DEFAULT CHARSET=gb2312;
这样在mysql里就可以显示中文了

2.
打MySQL安装目录,找到my.ini这个文件,用记事本打开
default-character-set=gb2312

这个字段就是设置编码的,后面的是编码格式.

 

 

抱歉!评论已关闭.