FreeBSD增加Mysql字符集

今天才发现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


「倘若有所帮助,不妨酌情赞赏!」

Holmesian

感谢您的支持!

使用微信扫描二维码完成支付


相关文章

发表新评论
暂无评论
  1. Hosxicv

    Hosxicv

    Hosxicv 回复