Here is my java method:
public void backup(String location)
{
Date date = new Date();
String DATE_FORMAT="MMM-dd-yyyy";
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
String fileName = sdf.format(date);
String fileLocation = location+fileName+".sql";
try
{
Runtime.getRuntime().exec("cmd /c C:/Program Files/MySQL/MySQL Server 5.5/bin/mysqldump -u root -ppassword iliassembly > "
+fileLocation);
}
catch (IOException e)
{
System.out.println(e.getMessage());
}
}
Any help is appreciated. Thanks!


Sign In
Create Account


Back to top









