public boolean backupMeans(String userName, String password,
String databaseName, String filePath) {
boolean bool = false;
// String command =
// "mysqldump -u"+userName+" -p"+password+" "+databaseName
// +" > "+filePath;
try {
// -uroot root是数据库的用户名 -p111111 111111是数据库的密码 aoyi是数据库名
// /tmp/aoyitest.sql是脚本在Linux系统中的保存位置
Runtime.getRuntime().exec("mysqldump -uroot -p111111 aoyi > /tmp/aoyitest.sql");
                          //创建备份脚本,执行没效//                         Runtime.getRuntime().exec("rm /tmp/aoyitest.sql");
                           // 删除文件的命令,执行有效
bool = true;
} catch (Exception e) {
e.printStackTrace();
}
return bool;
}