I was unable to join some tables because some of the tables/rows were utf8_general_ci and some were utf8_turkish_ci. Thus I had to dublicate the turkish one, convert it to general and finally use it. However I wonder, what will happen to my application if I convert the original table from turkish to general? I use MySQL with PHP.
This was the initial error: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_turkish_ci,IMPLICIT) for operation '='
Your columns' data are stored using a character set. In this case it seems to be utf8.
When you operate upon those columns (doing, for example, equality comparisons or ordering), MySQL employs a collation. Each column has a default collation, which it inherits from the table's default collation.
Indexes have the column's default collation baked in to them so they can function efficiently.
You can do an equality comparison that's qualified by collation. For example, in a
JOIN
you can specifyor perhaps
That should eliminate your illegal mix of collations without requiring you to alter your table. This may help you avoid the database change you're asking about. But beware, using the
COLLATE
qualifier can defeat the use of an index. If you have a large table and you are relying on indexes for performance, this may be unhelpful.So, what will happen if you alter your tables to change the default collation?
ORDER BY
results will be incorrect.But, you can fix that by specifying a
COLLATE
modifier in yourORDER BY
clause.