文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>MySQL通过配置文件配置字符编码

MySQL通过配置文件配置字符编码

时间:2008-04-25  来源:sdccf

作者: btchnia  出自: http://www.linuxdiyf.com
在安装的过程中,我们可以选择gb2312或者utf8作为字符编码,比较国际化的就是uft8,这样你的数据库可以“游历四方”了,但是却不能插入汉字的字段,可以修改一下配置文件

在安装目录下找到my.ini文件

[client]

port=3306

[mysql]

default-character-set=gbk

大概是57行的位置,这里改为gbk

#Path to installation directory. All paths are usually resolved relative to this.
basedir="D:/MySQL/MySQL Server 5.0/"

#Path to the database root
datadir="D:/MySQL/MySQL Server 5.0/Data/"

# The default character set that will be used when a new schema or table is
# created and no character set is defined
default-character-set=utf8
大概是81行的位置,这里写UTF8

这样,我们的MySQL就是一个具有utf8内部核心但是却能理解gbk编码的了。
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载