• FreeBSD下Mysql的字符集问题

    post by Holmesian / 2009-12-15 9:39 Tuesday

    今天才发现FreeBSD下通过Ports安装的mysql是不支持GBK等编码的 默认只支持UTF8编码

    于是乎使用GBK等编码的程序都出现了类似以下的错误

     

    引用
    SQL: SELECT s.sid, s.styleid, s.groupid='6' AS ipbanned, s.pageviews AS spageviews, s.lastolupdate, s.seccode, m.uid AS discuz_uid, m.username AS discuz_user, m.password AS discuz_pw, m.secques AS discuz_secques,
    m.adminid, m.groupid, m.groupexpiry, m.extgroupids, m.email, m.timeoffset, m.tpp, m.ppp, m.posts, m.threads, m.digestposts,
    m.oltime, m.pageviews, m.credits, m.extcredits1, m.extcredits2, m.extcredits3, m.extcredits4, m.extcredits5,
    m.extcredits6, m.extcredits7, m.extcredits8, m.timeformat, m.dateformat, m.pmsound, m.sigstatus, m.invisible,
    m.lastvisit, m.lastactivity, m.lastpost, m.prompt, m.accessmasks, m.editormode, m.customshow, m.customaddfeed, m.newbietaskid
    FROM [Table]sessions s, [Table]members '
    Error: Unknown collation 'gbk_bin' in table '[Table]sessions.frm' definition
    Errno.: 1273

    Discuz! info: MySQL Query Error



    解决方法
     

     

    cd /usr/ports/databases/mysql50-server

    make WITH_CHARSET=gbk WITH_XCHARSET=all WITH_COLLATION=gbk_chinese_ci BUILD_STATIC=yes install

     


     

    说两句:

    Hosxicv
    2009-12-18 01:40
    Hosxicv

    发表评论: