Illegal mix of collations

Started by Westwegoman, October 03, 2015, 08:40:30 PM

Previous topic - Next topic

Westwegoman

I get the following error in the error log periodically.

http://www.bayoustatefishing.com/community/index.php?action=login2
Apply Filter: Only show the errors with the same message
Database Error: Illegal mix of collations (latin1_general_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
Apply Filter: Only show the errors from this file
File: /htdocs/bsf/community/Sources/LogInOut.php
Line: 234


Any ideas?

SMF 2.0.11

Kindred

Well, it would seem that some of your database is Latin and some is UTF8...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Westwegoman

Hmmm. I wonder how that happened? Is there any way to fix this?

Kindred

Check all the tables in your database....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

shawnb61

It is not necessarily mixed tables in your DB, but it could be.   You can reproduce the error on an all Latin DB, no mixed collation, if the server passes search terms in UTF8.   Just search for some Turkish text, with a string copied from a Turkish post elsewhere on this site & see if you get the error...

Your DB can get mixed collations over time.  One thing I've noticed is that when SMF builds a new DB, it doesn't set the default collation for new tables.   You must do that manually after installation in myphpadmin.   If you don't, tables added by mods will match the DB default, and will be out of sync.  New tables may default to Latin if you don't set it yourself.

As Kindred said, look at all of your table collations in myphpadmin.   Also check out the default settings.

It's not hard to fix.   If you have a real mess (like I did...) there are scripts out there to fix the whole thing.

More here:
http://www.simplemachines.org/community/index.php?topic=537497.msg3819674#msg3819674
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Advertisement: