The problem isn't inserting table schema/data - I know how to do that.  

I'm referring to the process of inserting an actual FILE (txt, .bat, .jpg)
via command line.  And of pulling it out and giving it a name (test.txt).  



> -----Original Message-----
> From: Mark Horton [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 20, 2002 2:34 PM
> To: Stembridge, Michael
> Cc: [EMAIL PROTECTED]
> Subject: Re: Inserting files from command prompt
> 
> 
> I do this from the command line sometimes:
> 
> mysql -h HOST -pPASSWORD DATABASE < statements.sql
> 
> The statements.sql file should contain full sql statements.  
> This will 
> read in the file and execute the sql 1 line at a time.
> 
> The opposite would be to use mysqldump like so:
> 
> mysqldump -h HOST -pPASSWORD DATABASE TABLE > statements.sql
> 
> This would dump the contents of the given table in the given database 
> into the statements.sql file.  This create full insert 
> statements with 
> schema.  You can pass it many options; see the web page docs for more.
> 
> --Mark
> 
> 
> Paul DuBois wrote:
> > At 10:48 -0500 3/20/02, Stembridge, Michael wrote:
> > 
> >> Can a file be inserted to a mysql table from a unix(linux) command 
> >> prompt?
> > 
> > 
> > mysqlimport?
> > 
> >> Also, can I query the same table and output the data to a 
> filename.ext 
> >> in a
> >> specified directory?
> > 
> > 
> > SELECT ... INTO OUTFILE
> > 
> >> Not sure if this is an appropriate question for the list, but all
> >> clues/examples would be greatly appreciated.
> > 
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > Before posting, please check:
> >   http://www.mysql.com/manual.php   (the manual)
> >   http://lists.mysql.com/           (the list archive)
> > 
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail 
> > <[EMAIL PROTECTED]>
> > Trouble unsubscribing? Try: 
> http://lists.mysql.com/php/unsubscribe.php
> > 
> > 
> 
> 
> 

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to