How to completely resolve Phpcms V9 Post update the article published a MySQL 1267 error

Source: Internet
Author: User
Tags character set error code mysql mysql query

Completely resolve Phpcms V9 upgrade, the article published: MySQL query:select * from ' withli_a '. ' V9_keyword ' WHERE ' keyword ' = ' roar ' and ' siteid ' = ' 1 ' limi T 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 ' = '

(The above error code appears in Phpcms v9)

The above error is a problem with inconsistent database character sets.

Solution, enter the phpMyAdmin to execute the SQL statement:

To modify the encoding of a table:

ALTER TABLE ' V9_keyword ' DEFAULT CHARACTER SET gbk COLLATE gbk_chinese_ci

To modify the encoding of a field:

ALTER TABLE ' v9_keyword ' change ' keyword ' keyword ' CHAR (MB) CHARACTER SET GBK COLLATE gbk_chinese_ci not NULL

And then it's OK.

(Red characters, please modify the data table you need to modify in your database, please change the blue characters to the fields you need to modify in your database)

(Yellow background characters change to the encoding you want to modify, if you want to modify into UTF8, it should be UTF8 and utf8_bin) finally resolved.

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/web/Skills/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.