Home > Database > Mysql Tutorial > body text

What to do if 1267 error occurs in mysql

coldplay.xixi
Release: 2020-08-24 16:27:12
Original
5822 people have browsed it

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'
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template