Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am receiving a "Illegal mix of collations (latin1_general_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '='" error when executing a MySQL query in PHP. The odd thing is that the exact same query works when I run it in a phpMyAdmin window but fails when running in PHP.

The PHP query uses "User-Defined Variables" but Im not sure if that has something to do with this problem or not.

These are the settings from my server running the database:

character set client      utf8
(Global value)          latin1
character set connection  utf8
(Global value)          latin1
character set database  latin1
character set filesystem  binary
character set results     utf8
(Global value)          latin1
character set server      latin1
character set system      utf8
collation connection      utf8_general_ci
(Global value)          latin1_swedish_ci
collation database      latin1_swedish_ci
collation server          latin1_swedish_ci

I have been at this for hours and can't fix this problem. I am really not sure what to do. Do I have to modify the server settings above? My hosting provider moved me to a new server this past week and I believe that has something to do with it but I would like to know what the issue is first.

Any help and solutions would be greatly appreciated.

Thank you

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.