PDA

View Full Version : Problem with MYSQL code. Works locally but not on server



jarmanje
July 12th, 2008, 07:35 PM
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...

jwilliam
July 12th, 2008, 07:56 PM
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.

jarmanje
July 12th, 2008, 11:30 PM
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

jwilliam
July 13th, 2008, 02:26 PM
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.