Social Icons

Thursday, May 23, 2013

illegal mix of collations (latin1_swedish_ci implicit) and (latin1_general_ci implicit)

It is one of the common errors in MySql.

This error comes when you are fetching data from two or more than two tables via sql query and collation of those tables is not same. You have to make sure that the tables from which you are fetching data, have the same collation. After that also check the collation type of each table field that you have used in operation.
If collations are different, then you'll get the above error as illegal mix of collations.

To resolve this, you can change the collation of a table with the below query:

ALTER TABLE tbl_name CONVERT TO CHARACTER SET latin1 
COLLATE 'latin1_swedish_ci';

This will be the fix for the error.

1 comment:

  1. But what about when you are scrapping text from an email or something else?

    ReplyDelete

Total Pageviews