Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Posts
    8

    Unanswered: getting mysql output in a file

    i have a bat file which does the following:

    @echo off
    C:\mysql\bin\mysql -u root tms < d:/manish/spooled_files/tms_compliance_trend.sql

    basically executes the script file and populates the mysql table

    now if incase the process has some errors
    i would like to capture the details of the above process in a file

    i tried
    @echo off
    C:\mysql\bin\mysql -u root tms < d:/manish/spooled_files/tms_compliance_trend.sql > path/to/file/output.txt

    but it just created an empty file??

    help please!!!

  2. #2
    Join Date
    Jan 2003
    Location
    Paris, France
    Posts
    320
    You can use --tee=file_name option in the command parameter

    C:\mysql\bin\mysql -u root --tee=path/to/file/output.txt tms < d:/manish/spooled_files/tms_compliance_trend.sql

    Or use

    tee option in your sql file
    Olivier Miossec
    --
    http://www.lasso-developpeur.net/
    --

  3. #3
    Join Date
    Feb 2004
    Posts
    8
    ok as you said i tried this:

    C:\mysql\bin\mysql -u root --tee=d:/manish/output_log/log.txt tms < d:/manish/spooled_files/tms_compliance_trend.sql

    i got this message
    cant create/write to file d:/manish/output_log/log.txt
    errcode = 2

  4. #4
    Join Date
    Jul 2004
    Location
    Mars
    Posts
    137
    Do u have the directory /manish/output_log/ in your d: drive..?
    Sudar

    --
    My Blog

  5. #5
    Join Date
    Feb 2004
    Posts
    8
    yeah i got it
    but again it creates a blank file ??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •