problem description
String [] str = {
"mysqldump -h localhost -u root -p -t lailr_js_pay wx_sp > f:/test.sql"
,"root"
};
Runtime.getRuntime (str) .exec executes the mysqldump command to generate the sql file
but if it is not used, it will report an error
Exception in thread "main" java.io.IOException: Cannot run program "mysqldump-h localhost-u root-p-t lailr_js_pay wx_sp > f:/wx1.sql": the CreateProcess error=2, system cannot find the specified file.
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at com.test.Test.main(Test.java:18)
the Caused by: java.io.IOException: CreateProcess error=2, system cannot find the specified file.
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 4 more