Home  >  Article  >  Database  >  What to do if 1267 error occurs in mysql

What to do if 1267 error occurs in mysql

coldplay.xixi
coldplay.xixiOriginal
2020-08-24 16:27:125785browse

The solution to the 1267 error in mysql: execute [set names gbk] before executing the mysql query statement. gbk is the character set used to create the table. Please modify it according to the actual situation.

What to do if 1267 error occurs in mysql

The solution to the 1267 error in mysql:

If the character set used when creating the table is different from the mysql default The character sets are different. When querying, especially when there are Chinese characters, the following error often occurs:

 ERROR 1267 (HY000): Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation 'like'

The solution is:

Before executing the mysql query statement, execute "set names gbk". gbk is the character set used to create the table. Please modify it according to the actual situation!

Related learning recommendations: mysql tutorial

The above is the detailed content of What to do if 1267 error occurs in mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn