Re: Dumping table contents to stdout in tab-separated value format

2010-02-21 Thread Евгений Килимчук
Hello!
If you use *nix sistem. You can use the 'tail' utilit with -f flag.
In the first terminal you use: mysqldump or 'select * into outfile'.
In the second terminal you can use: tail -f file_name.
This is help for monitoring.

2010/2/21 Yang Zhang 

> Hi, I'm interested in piping out the contents of a mysql table to
> stdout in tab-separated value format, but:
>
> - using 'select * into outfile' can't write to stdout.
> - mysqldump --fields-... requires --tab, which requires an output file
> path.
> - I also tried mkfifo /tmp/pipe and "select * into outfile
> '/tmp/pipe'", but mysql complains about the file existing already.
>
> Is there any other quick way to do this without having to write a
> client app? Thanks in advance.
> --
> Yang Zhang
> http://www.mit.edu/~y_z/ 
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/mysql?unsub=ekilimc...@gmail.com
>
>


-- 
Best regards,

Eugene Kilimchuk 


Re: Dumping table contents to stdout in tab-separated value format

2010-02-20 Thread Jesper Wisborg Krogh

On 21/02/2010, at 2:03 PM, Yang Zhang wrote:


Hi, I'm interested in piping out the contents of a mysql table to
stdout in tab-separated value format, but:

- using 'select * into outfile' can't write to stdout.
- mysqldump --fields-... requires --tab, which requires an output  
file path.

- I also tried mkfifo /tmp/pipe and "select * into outfile
'/tmp/pipe'", but mysql complains about the file existing already.

Is there any other quick way to do this without having to write a
client app? Thanks in advance.


You can execute a query from the command line and use the -B (or -- 
batch) option.


mysql mysql -B -e "SELECT * FROM time_zone LIMIT 5"
Time_zone_idUse_leap_seconds
1   N
2   N
3   N
4   N
5   N



Re: Dumping table contents to stdout in tab-separated value format

2010-02-20 Thread Carlos Proal


I dont know if this can help, but if you are on unix/linux you can call 
cat after the dump and easily you can get the output to the stdout

ie:
$ mysqldumptempfile.txt... && cat tempfile.txt

Carlos

On 2/20/2010 9:03 PM, Yang Zhang wrote:

Hi, I'm interested in piping out the contents of a mysql table to
stdout in tab-separated value format, but:

- using 'select * into outfile' can't write to stdout.
- mysqldump --fields-... requires --tab, which requires an output file path.
- I also tried mkfifo /tmp/pipe and "select * into outfile
'/tmp/pipe'", but mysql complains about the file existing already.

Is there any other quick way to do this without having to write a
client app? Thanks in advance.
   



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Dumping table contents to stdout in tab-separated value format

2010-02-20 Thread Yang Zhang
Hi, I'm interested in piping out the contents of a mysql table to
stdout in tab-separated value format, but:

- using 'select * into outfile' can't write to stdout.
- mysqldump --fields-... requires --tab, which requires an output file path.
- I also tried mkfifo /tmp/pipe and "select * into outfile
'/tmp/pipe'", but mysql complains about the file existing already.

Is there any other quick way to do this without having to write a
client app? Thanks in advance.
-- 
Yang Zhang
http://www.mit.edu/~y_z/

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org