# Problem with MYSQL code. Works locally but not on server

**URL:** <https://forum.kirupa.com/t/problem-with-mysql-code-works-locally-but-not-on-server/265816>\
**Category:** programming\
**Created:** [July 12, 2008, 10:35pm UTC](https://forum.kirupa.com/t/problem-with-mysql-code-works-locally-but-not-on-server/265816 "2008-07-12T22:35:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jarmanje](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@jarmanje](https://forum.kirupa.com/u/jarmanje)\
**Post date:** [July 12, 2008, 10:35pm UTC](https://forum.kirupa.com/t/problem-with-mysql-code-works-locally-but-not-on-server/265816/1 "2008-07-12T22:35:55Z")

</div>

Hello,

I have a mysql join with some criteria which works perfect locally. i test the mysql in phpmyadmin and it generates the output perfectly,

I paste the EXACT same mysql into a clone database on my server and i get this error:

#1267 - Illegal mix of collations (latin1\_swedish\_ci,IMPLICIT) and (utf8\_bin,IMPLICIT) for operation ‘=’

Does anyone have any idea why this might be happening? I have run out of things to try, i simply don’t understand how it can work locally but not on my website’s server…

---

<div class="post-metadata">

**Author:** ![jwilliam](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jwilliam](https://forum.kirupa.com/u/jwilliam)\
**Post date:** [July 12, 2008, 10:56pm UTC](https://forum.kirupa.com/t/problem-with-mysql-code-works-locally-but-not-on-server/265816/2 "2008-07-12T22:56:08Z")

</div>

This is the first time I’ve seen that error, but it looks like the collations of the tables you’re using for your joins are different. Run “SHOW CREATE TABLE table\_name” on each of the tables used in your table join and post the output here.

Differences in a product and development server are often found when the software versions are different. I would imagine that your local box has a different version of mysql than your production server.

---

<div class="post-metadata">

**Author:** ![jarmanje](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@jarmanje](https://forum.kirupa.com/u/jarmanje)\
**Post date:** [July 13, 2008, 2:30am UTC](https://forum.kirupa.com/t/problem-with-mysql-code-works-locally-but-not-on-server/265816/3 "2008-07-13T02:30:15Z")

</div>

thanks for the reply

the remote server is version 4 and the local is version 5

what do you think i can do to solve it? Looks like mediatemple don’t have version 5 up yet

---

<div class="post-metadata">

**Author:** ![jwilliam](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jwilliam](https://forum.kirupa.com/u/jwilliam)\
**Post date:** [July 13, 2008, 5:26pm UTC](https://forum.kirupa.com/t/problem-with-mysql-code-works-locally-but-not-on-server/265816/4 "2008-07-13T17:26:42Z")

</div>

On most shared hosting servers you can choose which version of PHP you want to run (4 or 5). Perhaps this is possible with mySql as well… I’m honestly not sure. I would ask them that first (whether or not you have a choice of which version to run).

Other than that… all you can do is downgrade the version on your local machine.
