RE: redirect mysql output to file

2003-02-25 Thread David Lubowa
echo " MYSQL_STATEMENT" | mysql -u user_name -p>> /path/to/file this should work fine on command line . cheers David Ziggy Lubowa Network Engineer One2net (U) web: www.one2net.co.ug Tel: +256 41 345466 --- Every minute is an occasion to change your l

Re: redirect mysql output to file

2003-02-24 Thread Stefan Hinz
Mike, > How do i redirect a mysql output to a file from the command line? > For example, I want to save DESCRIBE test_table > test_table.file > without doing a MYSQLDUMP. To have the mysql client write a protocol, start it, and then do: mysql> tee myoutfile.txt Logging to file 'myoutfile.txt'

Re: redirect mysql output to file

2003-02-24 Thread Zak Greant
On Mon, Feb 24, 2003 at 10:50:53AM -0700, Mike Doanh Tran wrote: > Hi, > > How do i redirect a mysql output to a file from the command line? > For example, I want to save DESCRIBE test_table > test_table.file > without doing a MYSQLDUMP. Use the mysql command line client from your command lin

RE: redirect mysql output to file

2003-02-24 Thread Joe Stump
In *NIX you could do this: $ echo "sql commands here" | mysql -uroot -ppassword -hhost database > /path/to/file For extra scripting fun you could backup tables using this: for i in `echo "show databases" | /usr/local/mysql/bin/mysql -uroot | grep -v "Database"` do mysqldump -uroot $i > /path/t

Re: redirect mysql output to file

2003-02-24 Thread Robert Citek
At 10:50 AM 2/24/2003 -0700, Mike Doanh Tran wrote: >How do i redirect a mysql output to a file from the command line? >For example, I want to save DESCRIBE test_table > test_table.file >without doing a MYSQLDUMP. >From the command line: $ echo 'describe test_table' | mysql {dbname} > test_ta