<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="displaying-traces">
      </a>
      10.15.13 Displaying Traces in Other Applications
     </h3>
    </div>
   </div>
  </div>
  <p>
   Examining a trace in the
   <a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
    <span class="command">
     <strong>
      mysql
     </strong>
    </span>
   </a>
   command-line
      client can be made less difficult using the
   <code class="literal">
    pager
      less
   </code>
   command (or your operating platform's
      equivalent). An alternative can be to send the trace to a file,
      similarly to what is shown here:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa71324758"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SELECT</span> TRACE <span class="token keyword">INTO</span> <span class="token keyword">DUMPFILE</span> <span class="token keyword"><em class="replaceable">file</em></span>
<span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>OPTIMIZER_TRACE<span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   You can then pass this file to a JSON-aware text editor or other
      viewer, such as the
   <a class="ulink" href="https://jsonview.com/" target="_blank">
    JsonView
      add-on for Firefox and Chrome
   </a>
   , which shows objects in
      color and allows objects to be expanded or collapsed.
  </p>
  <p>
   <code class="literal">
    INTO DUMPFILE
   </code>
   is preferable to
   <code class="literal">
    INTO
      OUTFILE
   </code>
   for this purpose, since the latter escapes
      newlines. As noted previously, you should ensure that
   <a class="link" href="server-system-variables.html#sysvar_end_markers_in_json">
    <code class="literal">
     end_markers_in_json
    </code>
   </a>
   is
   <code class="literal">
    OFF
   </code>
   when executing the
   <code class="literal">
    SELECT
      INTO
   </code>
   statement, so that the output is valid JSON.
  </p>
 </div>
 <br/>
</div>
