title: How to lock all tables in one mysql db?
body: <p>I write a backup shell script to execute mysqldump.</p>
  
  <pre><code>mysqldump -u$BACKUP_USER -p$BACKUP_PASS --flush-logs --lock-tables $DB_NAME &gt; $SQL_FILE
  </code></pre>
  
  <p>My db's storage ENGINE is MyISAM. So I can't use <code>--single-transaction</code> option.
  The <code>--lock-tables</code> only lock one table in mysqldump progress.
  There are many databases in my MySQL instance, I don't want to use <code>--lock-all-tables</code>, it will lock all databases run in my server.
  So, How to lock all tables in ONE mysql database at sametime so I can dump it?</p>