title: Changing MySQL charset to UTF8 on linux so it will work with JDBC
body: <p>My application can be deployed on Win\Linux, and uses MySQL 5.5, and it may store data in different languages.  </p>
  
  <p>I changed my MySQL server to have the following charset variables set to UTF8:   </p>
  
  <ul>
  <li>character_set_client </li>
  <li>character_set_connection</li>
  <li>character_set_connection</li>
  <li>character_set_database</li>
  <li>character_set_results </li>
  <li>character_set_server </li>
  <li>character_set_system</li>
  </ul>
  
  <p>To do so, I added the following to my.ini:</p>
  
  <pre><code>[mysql] 
  default-character-set=utf8
  [mysqld]
  init_connect='SET collation_connection = utf8_unicode_ci'  
  init_connect='SET NAMES utf8'
  character-set-server=utf8
  collation-server=utf8_unicode_ci
  skip-character-set-client-handshake
  </code></pre>
  
  <p>It worked well on Windows (MySQL 5.5.21 64 bit), but when my application run on Linux (MySQL 5.5.2 64 bit) I'm getting the following error:</p>
  
  <pre><code>com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown character set: 'utf8mb4'
  </code></pre>
  
  <p>Anyone knows where does 'utf8mb4' came from and how can I overcome this?</p>
  
  <p>JDBC driver: 'mysql-connector-java-5.1.18-bin'</p>