mysql如何用jsp代码进行数据库备份
//导出
String mysql="mysqldump -uroot -proot --opt databasename > d:/test.sql";
java.lang.Runtime.getRuntime().exec("cmd /c "+mysql);
导入:
String mysql="mysqladmin -uroot -proot create databasename";
java.lang.Runtime.getRuntime().exec("cmd /c "+mysql);
path="mysql databasename < d:/test.sql";
java.lang.Runtime.getRuntime().exec("cmd /c "+path);