Chinaunix

标题: mysq 字符集问题 [打印本页]

作者: zyrf2001    时间: 2006-03-01 17:55
标题: mysq 字符集问题
表有字符集,字符集还有个子集,比如:
gbk (GBK Simplified Chinese) collations:
gbk_bin
gbk_chinese_ci (default)
这样虽然都是gbk,但是还是有可能不一样,如果要
update resource_bjie.usr_person u, authdb.user_info i set u.name=i.name
可能会出现错误:
Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (gbk_bin,IMPLICIT) for operation '=', SQL State: HY000, Error Code: 1267

解决办法
ALTER TABLE usr_person CONVERT  TO CHARACTER SET gbk COLLATE gbk_bin


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/13433/showart_79890.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2