Reputation: 1045
I'm having a problem when doing LIKE '' queries in mySQL
These are my variables
How could I change db collation? And tables? I have:
I guess I should convert every table InnoDB with utf8_general_ci
I guess DB is set to latin1_swedish_ci so I should change this also. Doing the process from answer 1) will avoid the Illegal mix of collations error in mySql right? Without changing any line of code...?
Upvotes: 0
Views: 1257
Reputation: 5140
Charset and collation can be set to utf8_general_ci no matter which engine you are using. So, no need to change the MyISAM to InnoDB if you don't need, you can just change the collation.
Charset and collation is set per column. You can alter a table as a whole, but that really goes and alters each column. Remember that the charset and collation set on a table is really just a default for new columns, and the charset and collation set on the database is just a default for new tables.
Lastly, you correctly have the client, connection and results charsets all set to utf8. This is essential, otherwise MySQL will transcode going in or out. Besure that your client code explicitly sets these when setting up the a database connection.
Upvotes: 2