title: Dump MySQL view as a table with data
body: <p>Say I have a view in my database, and I want to send a file to someone to create that view's output as a table in their database.</p>
  
  <p>mysqldump of course only exports the 'create view...' statement (well, okay, it includes the create table, but no data).</p>
  
  <p>What I have done is simply duplicate the view as a real table and dump that. But for a big table it's slow and wasteful:</p>
  
  <pre><code>create table tmptable select * from myview
  </code></pre>
  
  <p>Short of creating a script that mimics the behaviour of mysqldump and does this, is there a better way?</p>