If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > getting mysql output in a file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-16-04, 05:11
mks123 mks123 is offline
Registered User
 
Join Date: Feb 2004
Posts: 8
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!!!
Reply With Quote
  #2 (permalink)  
Old 11-18-04, 05:37
omiossec omiossec is offline
Registered User
 
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/
--
Reply With Quote
  #3 (permalink)  
Old 11-18-04, 23:04
mks123 mks123 is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 11-19-04, 02:25
Sudar Sudar is offline
Registered User
 
Join Date: Jul 2004
Location: Mars
Posts: 137
Do u have the directory /manish/output_log/ in your d: drive..?
__________________
Sudar

--
My Blog
Reply With Quote
  #5 (permalink)  
Old 11-22-04, 02:16
mks123 mks123 is offline
Registered User
 
Join Date: Feb 2004
Posts: 8
yeah i got it
but again it creates a blank file ??
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On