简体   繁体   中英

How to create E-R diagram in mysql

I am using MySQL. There are 28 tables in my database. I've tried to use MySQL Workbench to create ER diagram. As there are 28 tables, everything is messed up in diagram using MySQL Workbench. Is there any way to create ER Diagram which shows all relations properly between 28 tables??

Thanks

The only free app I've been able to find that generates decent graphics (not beautiful but quite clear) is SchemaSpy . It's a command line Java program that generates quite comprehensive HTML documentation for any DBMS.

To Create ER Diagram in MySQL follow these steps:

1.First install MySQL Workbench in your computer

  1. Click File->Import->Reverse Engineer MySQL Create Script.
  2. Click Browse and select your SQL create script.
  3. Make Sure "Place Imported Objects on a diagram" is checked.
  4. Click Execute Button.
  5. Click Model->Add Diagram.
  6. Open Catalog Tree and select/drag your tables on your ERR diagram.

SQL yog is one of the best tool which generate ERD and represents the relationship between different tables. It is also drag and drop utility and provide complete access to your mysql database.

Open the MySQL Workbench and then go to Database -> Reverse Engineer ( in this wizard you have 7 steps to generate the ER Diagram )

1-Connection Options:

For Stored Connection :( Select local instance )

For Password: Click on the Store in Vault.. and then enter your password

Then click on the next.

2-Connect to DBMS:

Click on the next (In this step you do not need to do anything)

3-Select Schemas

Here, select your desire Schema in order to generate an ER Diagram

4-Retrieves Objects

Click on the next (In this step you do not need to do anything)

5-Select Objects

In this step, you can click on the Show Filter to exclude some table if you like

在此处输入图片说明 Here, I exclude the emailAddresses table in order not to show that in the ER Diagram

6-Reverses Engineers

Click on the next (In this step you do not need to do anything)

7-Results

Click on the finish to see the Diagram

ERWin is another good tool. Allowing you to generate erd from sql code and sql code from er diagrams. Its a Drag and Drop utility.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM