Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1984135
  • 博文数量: 593
  • 博客积分: 20034
  • 博客等级: 上将
  • 技术积分: 6779
  • 用 户 组: 普通用户
  • 注册时间: 2006-02-06 14:07
文章分类

全部博文(593)

文章存档

2016年(1)

2011年(101)

2010年(80)

2009年(10)

2008年(102)

2007年(16)

2006年(283)

我的朋友

分类: BSD

2008-11-20 19:43:51

在FreeBSD下安装mysql支持GBK字符集:

#cd/usr/ports/databases/mysql51-server
# make WITH_CHARSET=gbk WITH_XCHARSET=all WITH_PROC_SCOPE_PTH=yes BUILD_OPTIMIZED=yes BUILD_STATIC=yes SKIP_DNS_CHECK=yes WITHOUT_INNODB=yes install clean
# cp /usr/local/share/mysql/my-small.cnf /etc/my.cnf
mysqld中加入bind_address=127.0.0.1
#rehash
#mysql_install_db
#chown –R mysql:mysql /var/db/mysql
#/usr/local/etc/rc.d/mysql-server forcestart
#/usr/local/bin/mysqladmin -u root password 'new-password'

mysql启动没有问题了,在rc.conf中添加mysql_enable="YES"

rhel4

Character set 'gbk' is not a compiled character set and is not specified in the '/usr/local/mysql/share/mysql/charsets/Index.xml' file

解决方法是在用configure生成Makefile时指定默认的编码和collation,即用如下选项配置mysql
./configure --prefix=/usr/local/mysql --with-charset=gbk --with-collation=gbk_chinese_ci --with-extra-charsets=big5,ascii,gb2312,gbk,utf8,latin1,ucs2
第一次只指定了charset没有指定collation,编译后还存在同样的不识别gbk的问题,第二次全部指定就可以了

阅读(1537) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~