0

I have a MySQL database say test. It contains 10 tables. I know I can do describe <table_name> to get skeleton of that table. But I have to do that for each table individually.

This is my problem. Any query or script I can write to get the skeleton of all those tables at time?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Raja G
  • 5,973
  • 14
  • 49
  • 82

2 Answers2

1

Try Like this

SELECT * FROM information_schema.columns Where TABLE_SCHEMA='test';
Vignesh Kumar A
  • 27,863
  • 13
  • 63
  • 115
0

mysqldump can be told to skip data and dump only table schema.

mysqldump --no-data test

Use options -u <user> to connect as <user> and -p to ask for password. Maybe you also want --compact to be less verbose and possibly other. Many adjustments to the contents can be made using other options.

Palec
  • 12,743
  • 8
  • 69
  • 138