title: Using utf8mb4 in MySQL
body: <p>In order to use 4-byte <code>utf8mb4</code> in MySQL (5.6.11), I have set the following variables in the <code>my.ini</code> file (<code>my.cnf</code> is not found). This file is located in a hidden folder named <code>Application Data</code> (<code>C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.6</code>) on Windows XP. It is not available under the installation directory.</p>
  
  <pre><code>[client]
  port=3306
  default-character-set=utf8mb4
  
  [mysql]
  default-character-set=utf8mb4
  
  [mysqld]
  init-connect='SET NAMES utf8mb4'
  collation_server=utf8mb4_unicode_ci
  character_set_server=utf8mb4
  </code></pre>
  
  <p>And then issuing the following command,</p>
  
  <pre><code>SHOW VARIABLES
  WHERE Variable_name
  LIKE 'character\_set\_%'
  OR Variable_name LIKE 'collation%';
  </code></pre>
  
  <p>still displays the following list.</p>
  
  <p><img src="https://i.stack.imgur.com/QclPf.png" alt="enter image description here"></p>
  
  <p>From the picture itself, it is clear that several variables are still using 3-byte <code>utf8</code>.</p>
  
  <hr>
  
  <p>Before doing this, the following command had already been issued to make corresponding changes to the database itself.</p>
  
  <pre><code>ALTER DATABASE database_name
  CHARACTER SET utf8mb4
  COLLATE utf8mb4_unicode_ci;
  </code></pre>
  
  <p>And the following command had also been issued on each and every table in the said database.</p>
  
  <pre><code>ALTER TABLE table_name
  CONVERT TO CHARACTER SET utf8mb4
  COLLATE utf8mb4_unicode_ci;
  </code></pre>
  
  <hr>
  
  <p>Nevertheless, what is the reason why some variables have not yet been set to the said character set as well as the collation? What is missing?</p>
  
  <p>The system (operating system) itself was restarted after every single task specified above had been carried out.</p>