Skip to content

Commit

Permalink
Merge pull request #24 from punktDeForks/fix/single-transaction
Browse files Browse the repository at this point in the history
FIX: Prevent table locks by using mysqldump --single-transaction
  • Loading branch information
grebaldi authored Aug 21, 2018
2 parents aff2cf2 + 64c19c8 commit 5c721b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public function remoteHostCommand(

$this->outputHeadLine('Transfer Database');
$this->executeLocalShellCommand(
'ssh -p %s %s %s@%s \'mysqldump --add-drop-table --host=\'"\'"\'%s\'"\'"\' --port=\'"\'"\'%d\'"\'"\' --user=\'"\'"\'%s\'"\'"\' --password=\'"\'"\'%s\'"\'"\' \'"\'"\'%s\'"\'"\'\' | mysql --host=\'%s\' --port=\'%s\' --user=\'%s\' --password=\'%s\' \'%s\'',
'ssh -p %s %s %s@%s \'mysqldump --single-transaction --add-drop-table --host=\'"\'"\'%s\'"\'"\' --port=\'"\'"\'%d\'"\'"\' --user=\'"\'"\'%s\'"\'"\' --password=\'"\'"\'%s\'"\'"\' \'"\'"\'%s\'"\'"\'\' | mysql --host=\'%s\' --port=\'%s\' --user=\'%s\' --password=\'%s\' \'%s\'',
[
$port,
$sshOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function createCommand($name)

$this->outputHeadLine('Backup Database');
$this->executeLocalShellCommand(
'mysqldump --add-drop-table --host="%s" --user="%s" --password="%s" %s > %s',
'mysqldump --single-transaction --add-drop-table --host="%s" --user="%s" --password="%s" %s > %s',
[
$this->databaseConfiguration['host'],
$this->databaseConfiguration['user'],
Expand Down

0 comments on commit 5c721b6

Please sign in to comment.