MyISAM / InnoDB

You can pass in the --single-transaction option to disable the table locks. (As most of the DB is InnoDB and these tables are independent, it's not a big deal to lose a small amount of consistency in them.)
 
This is what I use:

Dump:
Rich (BB code):
mysqldump -udatabase_user -p --single-transaction --skip-lock-tables database_name > /path/to/backup/database_name_$(date +%d.%m.%y).sql

Zip:
Rich (BB code):
tar -czf database_name_$(date +%d.%m.%y).tar.gz /path/to/backup/database_name_$(date +%d.%m.%y).sql

Restore:
Rich (BB code):
mysql -udatabase_user -p database_name < backup.sql
 
Top Bottom