List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:May 11 2001 5:22pm
Subject:Re: MySQL -- tee command ???
View as plain text  
On Fri, May 11, 2001 at 10:57:51AM -0600, Joseph Chow wrote:
> Hi, everyone,
> I have a question about the "tee" command in MySQL.  I know one of its applications
> is to log everything from the screen to the outfile for debugging purpose.  But how do I
> redirect output ONLY to outfile instead of both standard output (screen) and outfile. 
> Because I donot want to see millions of lines scolled down on the screen when I access to
> a huge database, but I still want to debug through looking at the content of the db.  I
> wish I make myself clearly.
> Please reply to me directly, because I am not on the mailing list yet.

tee is for interactive use, so you'll always see the output if you use
it.  You probably want to tell mysql to execute queries from a script
and save the output in another file:

	% mysql database_name < inputfile > outputfile

Batch mode changes the default output format to tab-delimited, though.
If you want tabular (table-format) output, use the -t option as well:

	% mysql -t database_name < inputfile > outputfile

> thanks,
> Joe Chow
MySQL -- tee command ???Joseph Chow11 May
  • Re: MySQL -- tee command ???Eric Fitzgerald11 May
  • Re: MySQL -- tee command ???Paul DuBois11 May