PDA

View Full Version : dumping query output


zodehala
12-01-2008, 10:11 PM
like you know we can print a command output into a file like following command

tasklist > c:\a.txt

but i want to print following query into a file

show create table user;

and

mysql -u root -p123 -f db < c:\x.sql

guelphdad
12-01-2008, 10:42 PM
use the \T option which appends your mysql session to an outfile.

you can either use it when you start up mysql or when you are in at the mysql prompt.

zodehala
12-01-2008, 11:52 PM
use the \T option which appends your mysql session to an outfile.

you can either use it when you start up mysql or when you are in at the mysql prompt.


mysql> show create table tp_tasks \t ;
Outfile disabled.