Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you are using InnoDB tables and therefore have transaction support, you don't need to lock the database at all you can just add the <a href="http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_single-transaction" rel="nofollow noreferrer"><code>--single-transaction</code></a> command line option. This gives you a consistent snapshot without locking anything by using the transaction mechanism.</p> <p>If you don't have transaction support you can get what you describe with the <a href="http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_lock-tables" rel="nofollow noreferrer"><code>--lock-tables</code></a> command line option, this will lock the databases. </p> <p>It's also worth noting that READ LOCKs aren't quite as good as they sound since any write operation will lock which will lock subsequent read operations, see <a href="http://www.mysqlperformanceblog.com/2010/04/24/how-fast-is-flush-tables-with-read-lock/" rel="nofollow noreferrer">this article</a> for more detials</p> <p><strong>Edit:</strong> I don't think it's possible to dump the format and data separately without the file writing permission and the <a href="http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_tab" rel="nofollow noreferrer"><code>--tab</code></a> option. I think your only option is to roll your own <code>mysqldump</code> script that uses one of the transaction or READ LOCK mechanisms that mysqldump uses. Failing that it may be easier to just postprocess a single dumpfile into the format you want.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload