彻底解决mysql乱码问题
最近想做个项目,因为项目不大,所以想用mysql数据库,比较灵巧,好久不用,测试过程老是出现乱码,通过查资料总算解决掉了。主要是数据库中的编码不一致造成的。
my.ini 设置default-character-set=gb2312
status;
show create table user;
在my.cf文件的[mysqld]段设置:
default-character-set=gb2312
2 单独设置某个数据库:
以下是参考的一些资料:
http://www.cjsdn.net/post/view?bid=2&id=192141&sty=3&age=0
http://linux.bloghome.cn/posts/197.html
http://www.web745.com/article_html/2006/09/434.html
my.ini 设置default-character-set=gb2312
status;
show create table user;
在my.cf文件的[mysqld]段设置:
default-character-set=gb2312
2 单独设置某个数据库:
以下是参考的一些资料:
http://www.cjsdn.net/post/view?bid=2&id=192141&sty=3&age=0
http://linux.bloghome.cn/posts/197.html
http://www.web745.com/article_html/2006/09/434.html
lunzi
2007-11-21 00:24:31
评论:2
阅读:84
引用:0
ok
@2007-11-22 23:22:52 lunzi
已经改成utf-8了,其实我们平时开发用的编码基本都是utf-8的,gb2312新建页面时默认的,当时测试,没考虑这个,就没改它。
utf-8
@2007-11-21 17:43:47 hofman
还是用utf-8好些,否则经常有些字符超出字符集了。
