title: Output MySQL source results to log file
body: <p>I am trying to execute foo.sql using the source command in MySQL.</p>
  
  <p>When I type the command, the file is sourced accordingly:</p>
  
  <pre><code>mysql&gt; source ~/foo.sql
  </code></pre>
  
  <p>Now, there are a lot of statements being executed in this file and I would like to review the success/failure of these statements.  Is there a way I can pipe the results of the statements to a log file, foo.txt?</p>
  
  <p>I am thinking something along the lines of:</p>
  
  <pre><code>mysql&gt; source ~/foo.sql into outfile ~/foo.txt
  </code></pre>
  
  <p>However, typing this command appears to assume that everything following the source statement is one file name; so it is trying to source a file named '~/foo.sql into outfile ~/foo.txt', which obviously doesn't exist. </p>