title: Preview all tables in MySQL 5.5
body: <p>I have a database which is poorly documented and I am attempting to understand what is in each of the 50 tables located in the database. I want to just see the first few rows to get an idea of this.</p>
  <p>For a single table I could type <code>SELECT * FROM TABLENAME1 LIMIT 10</code> and it works, but I am loathe to type this 50 times. Is there a way from the command line I can get output for all tables? Could I store this output somewhere?</p>
  <p>I found <a href="https://stackoverflow.com/questions/26496864/how-to-loop-through-all-sql-tables">this</a> which uses the <code>sp_MSforeachtable</code> command to accomplish this (<code>sp_MSforeachtable @command1=&quot;select count(*) from ?&quot;;</code>) but that gave me the following error:</p>
  <blockquote>
  <p>ERROR 1064 (42000): 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 'sp_MSforeachtable @command1=&quot;select count(*) from ?&quot;' at line 1</p>
  </blockquote>
  <p>(I'm using MySQL 5.5 on an Ubuntu 18.04 server).</p>