Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) for operation '='
时间: 2023-08-24 11:05:44 浏览: 167
这个错误提示是与MySQL数据库中的字符集(collation)相关的问题。它表示在进行比较操作时,出现了不同的字符集的混合。通常,这个错误会出现在数据库查询语句中的操作符(比如=、<>等)的两边使用了不同的字符集。比如,utf8mb4_general_ci和utf8mb4_unicode_ci是两种不同的字符集,当它们混合使用时就会导致此错误。
解决这个问题的方法是确保在进行比较操作时,两边使用相同的字符集。可以通过在比较操作符两边使用COLLATE关键字来指定相同的字符集。
例如,如果你的查询是这样的:SELECT * FROM table WHERE column1 = 'value',你可以修改为:SELECT * FROM table WHERE column1 COLLATE utf8mb4_general_ci = 'value'。这样就可以避免字符集混合导致的错误。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [mysql字段编码不一致导致Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_...](https://blog.csdn.net/chen417980762/article/details/127068037)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) for operat](https://blog.csdn.net/guyue35/article/details/108846249)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [mysql报错Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT)](https://blog.csdn.net/summer089089/article/details/109595986)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文