title: How to get a list of MySQL views?
body: <p>I'm looking for a way to list all views in a database.</p>
  
  <p>Initially I found and tried an <a href="http://forums.mysql.com/read.php?100,81717,81728" rel="noreferrer">answer on the MySQL forums</a>:</p>
  
  <pre><code>SELECT table_name
  FROM information_schema.views
  WHERE information_schema.views.table_schema LIKE 'view%';
  </code></pre>
  
  <p>How ever this doesn't work, returning an empty set. (I know they're in there!)</p>
  
  <p>These also fail:</p>
  
  <pre><code>mysql&gt; use information_schema;
  Database changed
  mysql&gt; select * from views;
  ERROR 1102 (42000): Incorrect database name 'mysql.bak'
  mysql&gt; select * from tables;
  ERROR 1102 (42000): Incorrect database name 'mysql.bak'
  </code></pre>
  
  <p>Why isn't this working?</p>