mysql produces different result on win7 and debian8
<p>I am working with a Debian Server with xampp 1.8.3-2 and mysqlserver version 5.6.14 installed. In the old database, latin1_german2_ci was used as character collation for the database and the tables because of the german characters like ä,ö,ü,ß etc.. Now, I have to convert the collation of the tables into utf8_unicode_ci(collate of database is still in latin1_german2_ci). But after that, queries like this don't produce the correct answers anymore. i.e. it not only give everything with <code>kö</code> but with <code>ko</code> as well. How can I fix this?</p>

<pre><code>SELECT * FROM users Where lastname like "%kö%" 
</code></pre>

<p><strong>edit</strong>: Just found one solution which uses <code>COLLATE</code>:</p>

<pre><code>SELECT * FROM users Where lastname like "%kö%" COLLATE utf8mb4_german2_ci
</code></pre>

<p>However, this has to be adjusted depend which server connection collation is used, so if the server connection collation is utf8_unicode_ci, the query has to be changed into</p>

<pre><code>SELECT * FROM users Where lastname like "%kö%" COLLATE utf8_german2_ci
</code></pre>

<p>So my question now: is there a better/more elegant way to solve my problem? Is there any option in the database to prevent this?</p>