Please reply to the list, not to me personally, so that
others can follow this discussion.

At 17:05 -0500 11/18/03, Denis Mercier wrote:
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

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:

The output from mysql seems fine because when it does write the value
of my blob I get a well formatted tar file,
I'm thinking that maybe tar cannot handle a stream as it's input?

That may be. In that case, you should invoke tar as


tar xf -

rather than as

tar x

--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, 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