title: How to set utf8mb4 on MySQL 5.7 (windows)
body: <p>I have an installation of MySQL 5.7 on a Windows 7 machine.
  I need to change the character set of the database in order to persist emoji.</p>
  
  <p>The configuration into my.ini:</p>
  
  <pre><code>[client]
  default-character-set = utf8mb4
  
  [mysql]
  default-character-set = utf8mb4
  
  [mysqld]
  default-character-set = utf8mb4
  character-set-client-handshake = FALSE
  character-set-server = utf8mb4
  collation-server = utf8mb4_unicode_ci
  </code></pre>
  
  <p>Into the windows services I saw that the configuration file path that is loaded is correct.</p>
  
  <p>Looking into database properties with the query:</p>
  
  <pre><code>SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
  </code></pre>
  
  <p>I got the following results:</p>
  
  <pre><code>Variable_name   Value
  character_set_client    utf8
  character_set_connection    utf8
  character_set_database  utf8mb4
  character_set_filesystem    binary
  character_set_results   utf8
  character_set_server    utf8
  character_set_system    utf8
  collation_connection    utf8_general_ci
  collation_database  utf8mb4_general_ci
  collation_server    utf8_general_ci
  </code></pre>
  
  <p>So, the values of collation_server, character_set_system, character_set_server, character_set_results, character_set_connection, character_set_client are wrong.</p>
  
  <p>How can I fix them?
  Thanks.</p>