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.
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!