On Tue, 2003-11-18 at 16:40, Paul DuBois wrote:
> At 16:21 -0500 11/18/03, Denis Mercier wrote:
> >here's what im trying to do, i have a tar file in a blob field
> >and i'm trying to retrieve it and pipe it directly into tar
> >to decompress it, without first writing it to the hard drive,
> >
> >here's what i've tried so far,
> >I create a text file called test1:
> >use my_db; 
> >select * into dumpfile "/usr/local/test1" from my_table;
> >
> >so when i try shell> mysql --pager < test1 | tar x
> >
> >the tar file does get written to /usr/local/test1 which is the step i'm
> >trying to avoid, and nothing seems to get piped to tar?
> 
> Right, because you've told the SELECT to write its output to
> /usr/local/test1, not to its standard output.  Hence, tar
> receives nothing.
> 
> >
> >
> >i also tried:
> >use my_db; 
> >select * from my_table;
> >
> >so when i try shell> mysql --pager < test1 | tar x
> >
> >the tar file does not get written to /usr/local/test1 but i still dont
> >get my untared files? write permissions are ok?
> >what am i missing?
> 
> Have you verified that the mysql command actually writes any output, for
> example, with this command:
> 
> shell> mysql --pager < test1 | wc
if i dont use into dumpfile "/usr/local/test1"

mysql --pager < test1 | wc
wc: :2: Invalid or incomplete multibyte or wide character
      2    1093   87836

I get this: with raw
mysql --raw < test1 | wc
      2       2      11

Invoke mysql, then issue a \h command and look in the output for
the line that begins with "system".

system  (\!)    Execute a system shell command.

Im running redhat 9


> Do you get any output from tar at all, such as an error message?
> Maybe the output from mysql isn't suitable.  Couple of things to try:
> 
> 1) --pager should be omitted. It serves no function here.
> 2) You might want to add --raw to the mysql command
> 
> 
> 
> -- 
> Paul DuBois, Senior Technical Writer
> Madison, Wisconsin, USA
> MySQL A
> B, www.mysql.com
> 
> Are you MySQL certified?  http://www.mysql.com/certification/
> 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to