Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mysql illegal mix of collations when all collations already standardized

Tags:

mysql

I'm getting a strange mysql error: when trying to insert a row into a table that includes the Look Of Disapproval - ಠ_ಠ - I get the following error:

Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation = 'select...

Sure enough, some of the tables in my database were set to the latin1_swedish_ci collation. I changed all of the tables to utf8_general_ci, but the error persists.

What am I missing?

like image 285
Ryan McGreal Avatar asked Dec 12 '25 10:12

Ryan McGreal


1 Answers

Collation can also be set at the individual column level.

See: http://dev.mysql.com/doc/refman/5.0/en/charset-collations.html
And: http://dev.mysql.com/doc/refman/5.1/en/create-table.html

Made it community wiki, so you can accept it without me getting @Dan's rep.

like image 129
Johan Avatar answered Dec 14 '25 06:12

Johan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!