Saturday, April 4, 2015

Dump db mySql Java

Dump db mySql Java


public static boolean runScript() throws Exception {
     String[] command = new String[] {"/bin/sh", "-c", "mysqldump -h HOST_NAME -uUSERNAME -pPASS DATABASE_NAME --databases --skip-add-drop-table --replace | gzip > /root/Desktop/databaseName.sql.gz"};
        Process process = Runtime.getRuntime().exec(command);
        process.waitFor();
        return true;
    }

No comments:

Post a Comment