0
Good afternoon.
I created a DB in Mysql named Pizzeria. I have tried various means of creating DB backup but haven’t had success.
The last code I tried was:
try {
File file = new File("Backup");
file.mkdir();
String nomeBkp = tfDiretorio.getText() + ".sql";
System.out.println(nomeBkp);
String dump = "cmd.exe /c C:\\MySQL\\MySQL Workbench CE 6.1.6\\mysqldump.exe --user=root --password=123456 pizzaria > Backup/" + nomeBkp;
Runtime bkp = Runtime.getRuntime();
bkp.exec(dump);
JOptionPane.showMessageDialog(rootPane, "Backup realizado com sucesso!");
} catch (IOException ex) {
JOptionPane.showMessageDialog(null, "Erro!" + ex.getMessage());
}
You pass a pro command windows command. If you try to run it in the command itself works?
– Giovani