Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. Redirecting the mysql bin log to the text file in java.

Redirecting the mysql bin log to the text file in java.

Scheduled Pinned Locked Moved Java
helpjavamysqlquestionlounge
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    don Moen
    wrote on last edited by
    #1

    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 !!!

    P S 2 Replies Last reply
    0
    • D don Moen

      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 !!!

      P Offline
      P Offline
      Pavan_Putra
      wrote on last edited by
      #2

      Try changing /C to /K ...

      It's not enough to be the best, when you have capability to be great....

      D 1 Reply Last reply
      0
      • P Pavan_Putra

        Try changing /C to /K ...

        It's not enough to be the best, when you have capability to be great....

        D Offline
        D Offline
        don Moen
        wrote on last edited by
        #3

        it din't work ... anybody has any solution ?

        1 Reply Last reply
        0
        • D don Moen

          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 !!!

          S Offline
          S Offline
          Scott Sauyet
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups