title: escape character mysql import
body: <p>Recently I needed to migrate my website and all of its contents. I backed everything up and manually unpacked everything on the new hosting. A very tedious process, to say the least.</p>
  
  <p>However, after the move I discovered that the the Wordpress database was borked and I just figured out the problem.</p>
  
  <p>The Unicode text character <code>’</code> (u8217) is used in some text portions of the site. For whatever unknown reason, this character is causing the inserts to terminate at that character. I know this because the text portions before that character successfully get inserted, and everything else is omitted. (I've edited this post because in my original post I thought it was the culprit was the <code>'</code> apostrophe character but it is the unicode character <code>’</code>)</p>
  
  <p>The command I used to backup is:</p>
  
  <pre><code>mysqldump --no-create-db --add-drop-table --all-databases -u [username] –p[password] -h [host] &gt; backup.sql
  </code></pre>
  
  <p>The command I'm using to import is:</p>
  
  <pre><code>mysql -u [username] -p[password] -h [host] &lt; backup.sql
  </code></pre>