MySQL mysqldump from Java code on Win7 issues

2012-05-24T15:09:57

Ok, my Java application is not able to perform a mysqldump backup using the windows runtime enviroment. I have printout code for caught exceptions and I see no exceptions being thrown, looks fine on the surface when the backup code is executed.

I have also tested the mysqldump command in the command-line console; and it works with no issue there.

Code:

Runtime rt = Runtime.getRuntime();
try {
    Process pr = rt.exec("mysqldump -u test --password=pass lager > newBackup.sql");

} catch (IOException ex) {
     System.out.println("IO error Runtime.  "+ex.getMessage());
}

Does anyone know why it will not dump/backup the database? Is there some permission I need to add or something (running windows 7).

Copyright License:
Author:「gorn」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/10732784/mysql-mysqldump-from-java-code-on-win7-issues

About “MySQL mysqldump from Java code on Win7 issues” questions

Ok, my Java application is not able to perform a mysqldump backup using the windows runtime enviroment. I have printout code for caught exceptions and I see no exceptions being thrown, looks fine o...
Here 2 similar questions, but they do not address the same exact issue, that I have: Dump File MySQL 5.6.10 https://dba.stackexchange.com/questions/42321/issue-on-mysqldump-in-mysql5-6 I have De...
I'm trying to retrieve a database from my Amazon RDS instance using mysqldump e.g. mysqldump –h myDBname.cra3xhjrgj69.eu-west-1.rds.amazonaws.com -u root –p --port 3306 --single-transaction --dat...
Try to backup mysql DB from Java application (IDE Netbeans) using the following command but can't seem to find the file even though I specified a path: Runtime.getRuntime().exec("C:\\Program Files\\
I want to backup mysql database with java. And I want to launch mysqldump.exe independently on location of mysqldump.exe. To launch mysqldump.exe I need to write full path to it : String execute...
I'm having this issues where I cant do a mysqldump (server restarts, errors, etc) Anyone have tried doing an rsync or copying the raw data on a live server without stopping the mysql server?
I'm trying to use mysqldump in my server, from the command line. root@xxxxx:/xx/xx/xx/backups/09-03-13# mysqldump db_name_xxxx --tab=. --user=xxxx --password=xxxxx mysqldump: Got error: 1045: ...
I made my database in mySQL and I exported it in a file using mysqldump. Is there a way to make my program on JAVA to connect in mysql and create an empty database with the stracture I saved in the...
I am moving servers between providers and I am going to do a mysqldump inside their network and then load the file to the remote database over the Internet using mysql --host .. < dump.sql. As...
I am facing a strange problem in Creating MySQL DB Backup in java with MysqlDump. When i run command in Command Prompt of Windows it executes easily without any problem and creates backup but when i

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.