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,438
  • 68
  • 55
  • 126
rɑːdʒɑ
  • 4,925
  • 13
  • 41
  • 77

2 Answers2

1

Try Like this

SELECT * FROM information_schema.columns Where TABLE_SCHEMA='test';
Vignesh Kumar A
  • 26,868
  • 11
  • 59
  • 105
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
  • 11,499
  • 7
  • 57
  • 127