1

I want to print the structure of a table fomr my database.
Now I use the mysql command:

DESCRIBE products;

But how do I get this output into a txt file? Like:

DESCRIBE products; > products.txt
Thom
  • 591
  • 4
  • 12
  • 30
  • Related, if it's of interest, I wrote a *Describe All Tables* in [this Answer](http://stackoverflow.com/a/38679580). – Drew Jul 31 '16 at 00:47

1 Answers1

2
mysql -u username -p -e 'DESCRIBE databasename.tablename' > output.txt
Sammitch
  • 30,782
  • 7
  • 50
  • 77