如何为数据库生成ERD或UML?(how to generate ERD or UML for a database?)
引用前面的问题 ,似乎不可能轻松自动生成UML或ERD图。 如何才能做到这一点? 即使是
describe fudforum.*;
的细节describe fudforum.*;
提供会做的伎俩,除了你不能使用通配符。有点像
mysqldump -d -u <username> -p<password> -h <hostname> <dbname>
但更具可读性?看起来devart不能在Linux上运行,但我正在研究它。
MySQL的:
mysql> mysql> describe fudforum.fud30_xmlagg; +----------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | name | varchar(255) | NO | | | | | url | varchar(255) | NO | | | | | forum_id | int(11) | NO | MUL | 0 | | | xmlagg_opt | int(11) | NO | | 2 | | | last_load_date | bigint(20) | NO | | 0 | | | custom_sig | text | YES | | NULL | | +----------------+--------------+------+-----+---------+----------------+ 7 rows in set (0.04 sec) mysql> mysql> quit; Bye thufir@dur:~$
Referencing a previous question, it doesn't seem possible to easily autogenerate a UML or ERD graph. How can this be done? Even the the detail which
describe fudforum.*;
provides would do the trick, except that you can't use a wildcard.Something like
mysqldump -d -u <username> -p<password> -h <hostname> <dbname>
but more readable?It looks like devart doesn't run on Linux, but I'm looking into that.
mysql:
mysql> mysql> describe fudforum.fud30_xmlagg; +----------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | name | varchar(255) | NO | | | | | url | varchar(255) | NO | | | | | forum_id | int(11) | NO | MUL | 0 | | | xmlagg_opt | int(11) | NO | | 2 | | | last_load_date | bigint(20) | NO | | 0 | | | custom_sig | text | YES | | NULL | | +----------------+--------------+------+-----+---------+----------------+ 7 rows in set (0.04 sec) mysql> mysql> quit; Bye thufir@dur:~$
原文:https://stackoverflow.com/questions/10475860