Home > Archive > MySQL Server Forum > August 2005 > How to print-out MySQL database structure?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to print-out MySQL database structure?
Martin

2005-08-13, 9:23 am

Is there any way in MySQL Admin to generate a print-out that shows the
structure of a table in a database? I really don't like having to
document this info by hand writing it on pieces of paper.

Thanks


Malcolm Dew-Jones

2005-08-13, 8:23 pm

Martin (martinvalley@comcas
t.net) wrote:
: Is there any way in MySQL Admin to generate a print-out that shows the
: structure of a table in a database? I really don't like having to
: document this info by hand writing it on pieces of paper.

You can do this from the mysql command line program.

google: mysql show


mysql> show databases
mysql> show tables
mysql> show columns from TABLE_NAME

and of course

mysql> desc TABLE_NAME




--

This space not for rent.
Bill Karwin

2005-08-13, 8:23 pm

Martin wrote:
> Is there any way in MySQL Admin to generate a print-out that shows the
> structure of a table in a database? I really don't like having to
> document this info by hand writing it on pieces of paper.


You can use the mysqldump command-line tool that comes with MySQL.
For purposes of documenting the schema, I'd recommend a usage

mysqldump --no-data --skip-opt --skip-comments --compact
[--user and --password options] "databasename"

See http://dev.mysql.com/doc/mysql/en/mysqldump.html for details on this
tool and its options.

Another option is to get a graphical representation of the database.
There are tools that can connect to a database, analyze the schema, and
create an ERD (entity relationship diagram) for you. One software
product that can do this, which is free for use with MySQL, is
DB-Designer 4 (http://www.fabforce.net/dbdesigner4/). Read its docs for
the feature of Reverse Engineering.

Regards,
Bill K.
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com