View Full Version : MySQL: Illegal mix of collations?
I have just ran this query on my MySQL database:
SELECT * FROM `ibf_members` WHERE `email` LIKE '%aquarist%'
And it has given this error:
#1267 - Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'like'
:confused: Something wrong methinks? :rolleyes:
I got the same error. when you first login to phpmyadmin, you can select this option:
MySQL connection collation: and there is a drop down. This type has to be set as the same type as your table entries otherwise all your mysql queries get that error. Either you can change the type of each field in the tables to utf blablabla or you can change your MySQL connection collation to be the latin sweidish blablabla.
jerometam
1-13-05, 03:39 AM
I got the same error, I have a archive database that is originally stored in big5 charset, when I import the database in latin1_sewdish_ci, all my data change to question marks...
If I import the data in big5, I have the same problem with KOTT and heemer:
Illegal mix of collations (big5_chinese_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '='
Anybody can help?
Question now is, is there a quick way to change all my tables and fields collation? and how come my table's and fields are set to latin1_swedish_ci in the first place?
I have changed my MySQL connection collation to latin1_swedish_ci for now so I can run the querys I need to, but what else will this affect? anything? if so then we could do with a way of changing all the table's/fields.
devinemke
1-13-05, 11:18 AM
mySQL 4.1 has extended support for multiple character sets. there are the character sets themselves and the "collations" which are sets of rules governing how strings are compared. every character set has a subset of collations (one being the default). character sets and collations can set at several levels: server, database, table, column. these heirachical settings govern the default set/collation for each subsetting. in other words if the default server character set is latin5 (ISO 8859-9 Turkish) then all databases/tables/columns will inheirts that set. the server level character set for powweb's mySQL servers is UTF-8 Unicode (utf8) with the default collation of utf8_general_ci.
databases created in pre 4.1 versions of mySQL will likely have the latin1 (ISO 8859-1 West European) character set with it's default collation of latin1_swedish_ci. to read more about all this goto http://dev.mysql.com/doc/mysql/en/Charset.html.
I am having the same problem but only when I try to run queries in phpmyadmin. From what I can tell everything is set to latin1_swedish_ci, but when I click on the SQL tab and run a query there it says:
#1267 - Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
Is there a switch somewhere that I missed to change the default? I'm 99% sure that everything says latin1_swedish_ci throughout the database... If I run the exact same query from php (not in phpmyadmin) it works fine.
Nevermind...it helps to thoroughly read the posts :) Thanks heemer
i have this problem too, who can help~~
vBulletin v3.6.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.