IOException
Hi , I got this error for the following code:
java.io.IOException: java.io.IOException: mysqldump --xml -u root -p formiga form: not found
String cmd [] = {"mysqldump --xml -u root -p formiga form","" };
Process p = Runtime.getRuntime().exec(cmd);
p.waitFor();
Could anyone please help me?
Thanks
Camila
[352 byte] By [
Camilaa] at [2007-11-27 6:04:30]

> String cmd [] = {"mysqldump --xml -u root -p formiga
1) Read API for IOException
2) Double check your mysqldump statement. I imagine this is the source of your trouble.
You can't put spaces between the flags and their values, at least not for password (-p).
Your statement should read "mysqldump -uroot -pformiga..." and so on.
Try something like
//windows
String cmd [] = {"cmd", "/c", "mysqldump --xml -u root -p formiga form","" };
//Linux
String cmd [] = {"konsole", "-e", "mysqldump --xml -u root -p formiga form","" };
Maybe someone else has a better idea though.
I can't speak to calling mysqldump from a java app since I've never done it, but the statement itself is definitely off.
MySql takes '-p formiga' to mean it needs a password (not given) and dump from the database 'formiga'.
It'll prompt for a password from the command line in this form. Then it will throw an error when it can't find the 'formiga' database.
From what I saw of the error the statement should look like
mysqldump --xml -uroot -pformiga form
Of course, if mysql isn't in your command path, it won't work either.
Message was edited by:
cimmerian76