Fixes wsp-10190: Fixes issue around encoding of mysql backups (dumps)

Now uses --result-file option for mysqldump.exe rather than using file system
redirection, which was causing encoding issues in some instances
This commit is contained in:
MattRichardson 2013-07-30 14:09:16 -07:00
parent 9a566507ea
commit fe22439f85

View file

@ -478,12 +478,11 @@ namespace WebsitePanel.Providers.Database
string cmd = Path.Combine(MySqlBinFolder, "mysqldump.exe"); string cmd = Path.Combine(MySqlBinFolder, "mysqldump.exe");
string bakFile = Path.Combine(BackupTempFolder, backupName); string bakFile = Path.Combine(BackupTempFolder, backupName);
string args = string.Format(" --host={0} --port={1} --user={2} --password={3} --opt --skip-extended-insert --skip-quick --skip-comments {4}", string args = string.Format(" --host={0} --port={1} --user={2} --password={3} --opt --skip-extended-insert --skip-quick --skip-comments --result-file=\"{4}\" {5}",
ServerName, ServerPort, ServerName, ServerPort, RootLogin, RootPassword, bakFile, databaseName);
RootLogin, RootPassword, databaseName);
// backup database // backup database
FileUtils.ExecuteSystemCommand(cmd, args, bakFile); FileUtils.ExecuteSystemCommand(cmd, args);
return bakFile; return bakFile;
} }