---
title: "Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLIC"
author: "robingdo"
date: "2011-12-22T00:05:40Z"
tags: []
categories: ["数据库"]
slug: "illegal-mix-of-collations-utf8-general-ci-implicit-and-utf8-unicode-ci-implic"
draft: false
lastmod: "2011-12-22T00:05:40Z"
id: 1320119
url: "https://robingdo.iteye.com/blog/1320119"
---

### 今天，在写触发器的时候，添加了一个更新语句，实在想不通。把更新语句拿出来单独执行。 抛出

Java代码 [![复制代码](http://lzj0470.iteye.com/images/icon_copy.gif)](http://lzj0470.iteye.com/blog/1070921 "复制代码") [![收藏代码](http://lzj0470.iteye.com/images/icon_star.png)![](http://lzj0470.iteye.com/images/spinner.gif)]()

1. Illegal mix of collations (utf8\_general\_ci,IMPLICIT) and (utf8\_unicode\_ci,IMPLIC

```
Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLIC
```

从Google搜索了一下，大概的意思是  
需要将两张表的编码方式一致。  
所以，我做了如下操作就好了。

Java代码 [![复制代码](http://lzj0470.iteye.com/images/icon_copy.gif)](http://lzj0470.iteye.com/blog/1070921 "复制代码") [![收藏代码](http://lzj0470.iteye.com/images/icon_star.png)![](http://lzj0470.iteye.com/images/spinner.gif)]()

1. ALTER TABLE articlecount CONVERT TO CHARACTER SET utf8 COLLATE utf8\_general\_ci;