title: Backwards compatible mysql dump
body: <p>I am trying to port a database from mysql 5.7 to mysql 5.5. 
  At first, I used the following command</p>
  
  <pre><code>mysqldump -u root -p --all-databases &gt; alldbs.sql
  </code></pre>
  
  <p>When I try to import the DB in mysql 5.5 I keep getting errors like </p>
  
  <blockquote>
    <p>ERROR 1064 (42000) at line 572: You have an error in your SQL syntax;
    check the manual that corresponds to your MySQL server version for the
    right syntax to use near 'STATS_PERSISTENT=0' at line 9</p>
  </blockquote>
  
  <p>where it complains about <code>STATS_PERSISTENT=0</code> statement.</p>
  
  <p>Then I tried</p>
  
  <pre><code>mysqldump -u root -p --compatible=mysql40 --all-databases &gt; alldbs.sql
  </code></pre>
  
  <p>but this just gives me</p>
  
  <blockquote>
    <p>ERROR 1064 (42000) at line 26: You have an error in your SQL syntax;
    check the manual that corresponds to your MySQL server version for the
    right syntax to use near 'TYPE=InnoDB' at line 22</p>
  </blockquote>
  
  <p>where it complains about <code>TYPE=InnoDB</code> statement, which should be <code>ENGINGE=InnoDB</code>. Even with the <code>--compatible</code> option it still keeps the <code>STATS_PERSISTENT</code> statement.</p>
  
  <p>Is there a way to port a mysql 5.7 database to mysql 5.5?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>To be clear on my question, I am looking for <em>relialble</em>, i.e. no-hack way, to port the database. I already tried to replace <code>TYPE</code> with <code>ENGINE</code>, remove <code>STATS_PERSISTENT</code> etc. Something else always came up. I am not willing to jump through those hoops everytime I port the database. I am looking for a reliable way via <code>mysqldump</code> or a similiar tool to do the job.</p>
  
  <p>If this is not possible then I will have to switch to an alternative DB.</p>