EPUB | CHM | PDF

Reverse Engineering MySQL Database

Top Previous Next

With Database Designer for MySQL you can reverse engineer an existing MySQL database. This means that you can extract the database tables, attributes, relationships, indexes, views, stored procedures and other objects from the database to your diagram.

To reverse engineer MySQL database:

1. Select Reverse Engineering (reverse-engineering) item on Database tab of the Ribbon or press Ctrl+R.

2. If the currently opened diagram already contains some objects, a warning dialog box will appear:
reverse-non-empty-warning

It requests you to create a new diagram to place the reversed objects into or use the currently opened diagram.

Click Yes to create a new diagram or No to use the currently opened diagram. Click Cancel to cancel reverse engineering.
Select Do not show this dialog again to disable future notifications.

3. If connection for the current diagram has not been established, Database Connection Manager will be shown. Select a profile from the list of the available ones or create a new profile to connect to the database you want to revere engineer.

4. The MySQL Database Reverse Engineering tool will be shown.

reverse-options

You can set the reverse engineering options in the Options tab.

Reverse Engineer references
This option enables extracting foreign keys from the database and creating appropriate references in your diagram.

Automatically build references if none were reversed
If there are no physical references extracted, it is possible to build them from a logical structure of the database. Enabling this feature leads to automatic reconstruction of references. Such reconstruction works by the following scheme: each column of the table is being compared with all primary keys of other tables, and if the column name and data type match one of the primary keys, a reference between the source column and the key column will be created. This option is available for modification only if Build references is checked.

Tables in a diagram row
This option determines how reversed tables will be disposed on the diagram. Reversed tables will be placed on the diagram in rows with equal distance, this option determines how many tables maximum there will be in one row.

5. In the Selection tab of the MySQL Database Reverse Engineering dialog you can choose the objects you want to reverse engineer.

reverse-selection

There are several subtabs: Tables, Views, Stores Procedures, Events. Each of them allows you to select appropriate database objects. Click on the checkbox near the object to enable its reverse engineering. Pay attention to the Select All (select-all-items) and Deselect All (deselect-all) buttons on the tab, they allow you to select/deselect all objects in the list.

6. Click OK to start the database reverse engineering process. The Output -> Reverse docking window will display the state of the process.

7. The reversed database objects will be placed in your diagram.

See also:
Database Accessing Tools: Database Connection Manager
Reverse Engineering and Import: Reverse Engineering and Import Overview | Import from Access Database | Universal Reverse Engineering