Redirecting the mysql bin log to the text file in java.
-
hi, m trying to redirect the output of the binary log file of mysql into some other text file. the code i've written is .. Process runtimeProcess = Runtime.getRuntime().exec("cmd /C mysqlbinlog " + fileName + " > c:\\ logDump"); int processComplete = runtimeProcess.waitFor(); this redirects the output, but the "logDump" file formed does not contain the queries, only the general things which are in the binary log file. if i do the process manually on the command prompt, it works fine. wots the problem ??? somebody help !!!
-
hi, m trying to redirect the output of the binary log file of mysql into some other text file. the code i've written is .. Process runtimeProcess = Runtime.getRuntime().exec("cmd /C mysqlbinlog " + fileName + " > c:\\ logDump"); int processComplete = runtimeProcess.waitFor(); this redirects the output, but the "logDump" file formed does not contain the queries, only the general things which are in the binary log file. if i do the process manually on the command prompt, it works fine. wots the problem ??? somebody help !!!
Try changing /C to /K ...
It's not enough to be the best, when you have capability to be great....
-
Try changing /C to /K ...
It's not enough to be the best, when you have capability to be great....
-
hi, m trying to redirect the output of the binary log file of mysql into some other text file. the code i've written is .. Process runtimeProcess = Runtime.getRuntime().exec("cmd /C mysqlbinlog " + fileName + " > c:\\ logDump"); int processComplete = runtimeProcess.waitFor(); this redirects the output, but the "logDump" file formed does not contain the queries, only the general things which are in the binary log file. if i do the process manually on the command prompt, it works fine. wots the problem ??? somebody help !!!
Your code works fine for me as is. The only thing I can imagine is that perhaps you have spaces in the file name and Window's command processor is not dealing with them appropriately. Note that the output of mysqlbinlog is a fairly complicated format that includes much more than just the queries run, but you should be able to find them in the output. Cheers, -- Scott