How to generate ER Diagram from existing MySQL Database

Posted on

How to generate ER (Entity Relationship) Diagram from existing MySQL Database precisely ?. There are many tools or utilities available which is provided out there to accomplish this task. But in this article, there is one which is quite famous and it is going to be used in this article for generating ER (Entity Relationship) Diagram from a database which has already existed before in a MySQL Database Server is ‘MySQL Workbench’.

So, the step for generating ER (Entity Relationship) Diagram from a database which is already exist in a MySQL Database Server is shown below :

1. Just execute MySQL Workbench. Below is the display of MySQL Workbench executed :

How to generate ER Diagram from existing MySQL Database
How to generate ER Diagram from existing MySQL Database

2. Click the Model Icon in the left sidebar of MySQL Workbench as shown below :

How to generate ER Diagram from existing MySQL Database
How to generate ER Diagram from existing MySQL Database

3. Click on the third button in the Models Panel as shown below :

How to generate ER Diagram from existing MySQL Database
How to generate ER Diagram from existing MySQL Database

By executing the click on the button shown above, there are an additional menu presented which is specifically shown to Create EER Model. The first menu’s label is ‘Create EER Model from Database’ and the second menu’s label is ‘Create EER Model from Script’. So, to create an ER (Entity Relationship) Diagram from an existing database, just click the menu displayed in the first row which is ‘Create EER Model from Database’. There will be a dialog boxas shown below :

How to generate ER Diagram from existing MySQL Database
How to generate ER Diagram from existing MySQL Database

Choose the available Stored Connection which is defining the already stored MySQL Database connection. Fill the necessary field as shown in the above image especially those columns which are important to connect to the database exist in MySQL Database Server. Click the Next button to proceed.

4. The next window is for connecting to the DBMS which is going to be extracted for gaining its ER (Entity Relationship) Diagram as shown below :

How to generate ER Diagram from existing MySQL Database
How to generate ER Diagram from existing MySQL Database

5. Click the Next button since it is only showing the result of connecting to a certain DBMS. The following window will be presented :

How to generate ER Diagram from existing MySQL Database
How to generate ER Diagram from existing MySQL Database

The above window display will display list of available schemas or databases exist in MySQL Database Server. Choose the one which is going to be generated for its ER (Entity Relationship) Diagram as shown in the image above, it is indicated by the check box which is checked. In the above context, the name of the schema or database is ‘infra’ for an example. Click Next to continue the process of generating the ER (Entity Relationship) Diagram.

  1. If the process is successfully carried out, in the window displayed below will show the successfully retrieved objects :
How to generate ER Diagram from existing MySQL Database
How to generate ER Diagram from existing MySQL Database

7. After Clicking the Next button on the window above, there will be another windows shown below :

How to generate ER Diagram from existing MySQL Database
How to generate ER Diagram from existing MySQL Database

8. In the above image, all of the tables are selected to be imported into an ER (Entity Relationship) Diagram. So, in order to be processed further, just click the Execute Button. The output will be another window as shown below :

9. In the above window, after successfully importing all of the tables into an ER (Entity Relationship) Diagram as shown above, just click the Next button to finish the process. It will show a window as specified in the following image :

How to generate ER Diagram from existing MySQL Database
How to generate ER Diagram from existing MySQL Database

10. The above image is summarizing the total amount of the table generated from the previous step. Just click the Close button to finish the process. There will be a window as shown below :

As shown above, the step for generating ER (Entity Relationship) Diagram from an existing database in a MySQL Database Server using MySQL Workbench has already finished.

Leave a Reply