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