Compressing SQL dumps on-the-fly

In mysql it is possible to create a gzip database dump on-the-fly:

mysqldump -u user -ppassword mydatabase | gzip --fast > mydatabase.sql.gz

(the option fast compress file quickly)

If you need to dump all databases:

mysqldump -u user -ppassword --all-databases | gzip --fast > mydatabase.sql.gz 

Comments

Force the lock of the tables

We can force the lock of the tables with --lock-tables or --opt (for a single database) see also : http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html

Écrire un nouveau commentaire

The content of this field is kept private and will not be shown publicly.
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.

© 2009-2011 Linalis.com | Tous les articles sont sous licence CC by-sa | login

Formations Drupal | Formations Pentaho | Formations LPI | Contactez-nous