title: utf8 garbled when importing into mysql
body: <p>Importing UTF8-encoded data into mysql is not working for me. UTF8 characters are corrupted. For example <strong>Nöthnagel</strong> is displayed as <strong>NÃ¶thnagel</strong></p>
  
  <p>I have created a sql dump file to do the importing which contains UTF-8 encoded data. For example:</p>
  
  <pre><code>INSERT INTO `users` VALUES(1, 'Fred','Nöthnagel');
  </code></pre>
  
  <p>The sequence of bytes representing <strong>ö</strong> in the file is c3 b6 which I believe is correct, as it displays correctly in vim and in my bash shell which has these environment variables set:</p>
  
  <pre><code>$ env | grep -i utf
  LANG=en_US.UTF-8
  XTERM_LOCALE=en_US.UTF-8
  </code></pre>
  
  <p>The mysql db was created as follows:</p>
  
  <pre><code>mysql&gt; CREATE DATABASE mydb CHARACTER SET utf8;
  </code></pre>
  
  <p>The mysql table was created so:</p>
  
  <pre><code>CREATE TABLE `users` (  
      `id` int(11) NOT NULL AUTO_INCREMENT,  
      `first_name` varchar(30) NOT NULL,  
      `last_name` varchar(30) NOT NULL,
      PRIMARY KEY (`id`),  
      UNIQUE KEY `last_name` (`last_name`)  
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;  
  </code></pre>
  
  <p>I am importing the dump file like so:</p>
  
  <pre><code> mysql -u root -psecret mydb &lt; mydump.sql
  </code></pre>
  
  <p>Please tell me what is missing from the above.</p>