如何彻底解决phpcms v9升级后文章发布出现Mysql 1267错误
1个回答
2015-08-25
展开全部
彻底解决phpcms v9升级后,文章发布出现:MySQL Query : SELECT * FROM `withli_a`.`v9_keyword` WHERE `keyword` = '吼吼' AND `siteid` = '1' LIMIT 1
MySQL Error : Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (gbk_chinese_ci,COERCIBLE) for operation '='
MySQL Errno : 1267
Message : Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (gbk_chinese_ci,COERCIBLE) for operation '='
(上面这个错误代码是phpcms v9中出现的)
出现上面的错误,是数据库字符集不一致的问题。
解决办法,进phpmyadmin里面执行SQL语句:
修改表的编码:
ALTER TABLE `v9_keyword` DEFAULT CHARACTER SET gbk COLLATE gbk_chinese_ci
修改字段的编码:
ALTER TABLE `v9_keyword ` CHANGE `keyword ` `keyword ` CHAR( 100 ) CHARACTER SET gbk COLLATE gbk_chinese_ci NOT NULL
然后就可以了.
MySQL Error : Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (gbk_chinese_ci,COERCIBLE) for operation '='
MySQL Errno : 1267
Message : Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (gbk_chinese_ci,COERCIBLE) for operation '='
(上面这个错误代码是phpcms v9中出现的)
出现上面的错误,是数据库字符集不一致的问题。
解决办法,进phpmyadmin里面执行SQL语句:
修改表的编码:
ALTER TABLE `v9_keyword` DEFAULT CHARACTER SET gbk COLLATE gbk_chinese_ci
修改字段的编码:
ALTER TABLE `v9_keyword ` CHANGE `keyword ` `keyword ` CHAR( 100 ) CHARACTER SET gbk COLLATE gbk_chinese_ci NOT NULL
然后就可以了.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询