Good afternoon, I have a cmd that correctly backs up my database, but when running in java it does not open the cmd in the expected way, it follows the code:
package sistemaMiriam.backup;
import java.io.IOException;
public class MySQLBackup {
public static void main(String[] args){
String comando = "C:\xampp\mysql\bin\mysqldump sistema_miriam -u root -p ";
try {
Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL "+comando);
} catch (IOException e) {
e.printStackTrace();
}
}
}
If I put C:\xampp\mysql\bin\mysqldump sistema_miriam -u root -p >nomeParaArquivo.sql
it executes >nomeParaArquivo.sql
as if it were a table and not create a file with the bd data