# Mysql::Error: Illegal mix of collations (latin1\_swedish\_ci,IMPLICIT) and (utf8\_general\_ci,COERCIBLE)

**URL:** <https://www.ruby-forum.com/t/mysql-illegal-mix-of-collations-latin1-swedish-ci-implicit-and-utf8-general-ci-coercible/173169>\
**Category:** Rails\
**Created:** [August 4, 2009, 10:24am UTC](https://www.ruby-forum.com/t/mysql-illegal-mix-of-collations-latin1-swedish-ci-implicit-and-utf8-general-ci-coercible/173169 "2009-08-04T10:24:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![HeChian\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/3ec8ea/32.png) [@HeChian\_H](https://www.ruby-forum.com/u/HeChian_H)\
**Post date:** [August 4, 2009, 10:24am UTC](https://www.ruby-forum.com/t/mysql-illegal-mix-of-collations-latin1-swedish-ci-implicit-and-utf8-general-ci-coercible/173169/1 "2009-08-04T10:24:56Z")

</div>

Hi, I’ve got an error when I upload a record by iPhone with Chinese  
character.

Processing ScoresController#create (for 123.204.56.133 at 2009-08-04  
16:19:52) [POST]  
Parameters: {“score”=\>{“score”=\>“79.60”, “player\_name”=\>“¤@”,  
“iphone\_identifier”=\>“6b194f783d645ba1a7c30c0e31b1b67300eb0a25”},  
“product\_id”=\>“7”}  
^[[4;35;1mSQL (0.1ms)^[[0m ^[[0mSET collation\_database =  
‘utf8\_general\_ci’ ^[[0m  
^[[4;36;1mSQL (0.1ms)^[[0m ^[[0;1mSET collation\_connection =  
‘utf8\_general\_ci’ ^[[0m  
7— !map:HashWithIndifferentAccess  
score: “79.60”  
player\_name: !binary |  
5LiA

iphone\_identifier: 6b194f783d645ba1a7c30c0e31b1b67300eb0a25  
^[[4;35;1mSQL (0.2ms)^[[0m ^[[0mSHOW VARIABLES LIKE  
‘collation\_database’^[[0m  
Collation: utf8\_general\_ci  
^[[4;36;1mScore Load (0.0ms)^[[0m ^[[0;1mMysql::Error: Illegal  
mix of collations (latin1\_swedish\_ci,IMPLICIT) and  
(utf8\_general\_ci,COERCIBLE) for operation ‘=’: SELECT \* FROM  
`scores` WHERE (`scores`.`product_id` = ‘7’ AND  
`scores`.`iphone_identifier` =  
‘6b194f783d645ba1a7c30c0e31b1b67300eb0a25’ AND `scores`.`player_name`  
= ‘¤@’) LIMIT 1^[[0m

ActiveRecord::StatementInvalid (Mysql::Error: Illegal mix of  
collations (latin1\_swedish\_ci,IMPLICIT) and  
(utf8\_general\_ci,COERCIBLE) for operation ‘=’: SELECT \* FROM `scores`  
WHE  
RE (`scores`.`product_id` = ‘7’ AND `scores`.`iphone_identifier` =  
‘6b194f783d645ba1a7c30c0e31b1b67300eb0a25’ AND `scores`.`player_name`  
= ‘¤@’) LIMIT 1):  
app/controllers/scores\_controller.rb:59:in `create’

Any ideas?  
Thank you.

HeChian H.  
removed\_email\_address@domain.invalid
