Skip to content

Commit 14c5076

Browse files
committed
dump mysql database using --single-transaction
1 parent 809e475 commit 14c5076

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

func/db.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ dump_mysql_database() {
347347
exit $E_CONNECT
348348
fi
349349

350-
mysqldump -h $HOST -u $USER -p$PASSWORD -r $dump $database 2>/tmp/e.mysql
350+
mysqldump --single-transaction -h $HOST -u $USER -p$PASSWORD \
351+
-r $dump $database 2>/tmp/e.mysql
351352
if [ '0' -ne "$?" ]; then
352353
rm -rf $tmpdir
353354
echo -e "Can't dump database $database\n$(cat /tmp/e.mysql)" |\

0 commit comments

Comments
 (0)