How to Reverse Engineer a Database in MySQL Workbench

To reverse engineer a database in MySQL Workbench:

  1. Select Database > Reverse Engineer from the top menu of MySQL Workbench
  2. Set/review parameters for connecting to the DBMS then click Continue
  3. Enter password if required, then click OK
  4. The wizard will connect to the DBMS, fetch a list of databases, and check for any issues. Click Continue
  5. Select the database/s you would like to reverse engineer, then click Continue
  6. The wizard will retrieve all objects from the selected schema/s and check the results. Click Continue
  7. Select the database objects you’d like to have reverse engineered, then click Execute
  8. The wizard will now reverse engineer all selected objects and generate the EER diagram (behind the scenes). Click Continue
  9. A summary is displayed. Click Close

The EER diagram is now displayed on the screen.

Below are screenshots for the above steps.

Start

Select Database > Reverse Engineer from the top menu of MySQL Workbench. You don’t need to be connected to any MySQL instance at this stage – the wizard will ask you to connect at the next step.

Screenshot of selecting Reverse Engineer from the top menu in MySQL Workbench
Selecting “Reverse Engineer” from the “Database” menu starts the process.

Set Parameters

Set/review parameters for connecting to the DBMS then click Continue:

Screenshot of DBMS parameter screen in MySQL Workbench
Here you enter the details of the DBMS that contains the database that you wish to reverse engineer.

Enter Password

Enter password if required, then click OK. This is the password required to make the connection. It will typically be the password you use when connecting to the instance via MySQL Workbench:

Screenshot of password prompt
The Password prompt.

Connecting

Workbench will connect to the DBMS, fetch a list of databases, and check for any issues. Click Continue:

Screenshot of DBMS connection
The “Connect to DBMS and Fetch Information” screen. Once it has connected to the DBMS specified in the previous step, it will display this screen.

Select Schema/s

Select the database/s you would like to reverse engineer, then click Continue:

Screenshot of the Select Schemas screen
The “Select Schemas” screen prompts you to select the schema/s you’d like to engineer. You can reverse engineer any of the schemas listed.

Retrieving Objects

MySQL Workbench will retrieve all objects from the selected schema/s and check the results. Click Continue:

Screenshot of the Retrieve and Reverse Engineer Schema Objects screen
The “Retrieve and Reverse Engineer Schema Objects” screen simply informs you that it has in fact, retrieved the objects from the database/s.

Select Objects

Select the database objects you’d like to have reverse engineered, then click Execute:

Screenshot of the Select Objects to Reverse Engineer screen
The “Select Objects to Reverse Engineer” screen allows you to select the objects yo’d like to reverse engineer. The database in this example is simple and only contains 3 tables. If the database contained more objects, they’d be listed here.

Generating

MySQL Workbench will now reverse engineer all selected objects and generate the EER diagram (behind the scenes). Click Continue:

The Reverse Engineering Progress screen
The “Reverse Engineering Progress” screen simply informs you that the wizard is performing the reverse engineering process and generating the EER diagram (behind the scenes).

Summary

A summary is displayed. Click Close:

Screenshot of the Summary screen
This is the final summary of the process. It outlines everything that was reverse engineered.

The Result

The EER diagram is now displayed on the screen. Here’s an example:

Screenshot of EER diagram
This EER diagram was generated by reverse engineering a database and its objects.