Create EER diagram from existing database mysql workbench
Jun 30, 2025 am 12:47 AMUse MySQL Workbench to quickly generate EER diagrams from existing databases. The specific steps are: 1. Create a new model in Model Explorer; 2. Select "Create EER Model from Existing Database" and configure database connections; 3. Enter the reverse engineering process and select the tables and other objects to be imported; 4. After the generation is performed, view the EER diagram and manually adjust the missing associations; 5. Export the chart to PNG or PDF format for sharing. The entire process relies on foreign key constraints to ensure the accuracy of the relationship. If there is no foreign key, it needs to be supplemented manually.
If you already have a ready-made MySQL database and want to quickly generate EER graphs (enhanced entity relationship graphs), MySQL Workbench is a very practical tool. It can reversely generate EER graphs directly from the database structure, helping you understand the relationships between tables more intuitively.

Below are some practical operation suggestions and precautions to help you complete this process smoothly.

Open Model Explorer and create a new model
In the MySQL Workbench main interface, click the "Model" icon on the left to enter Model Explorer. Here you can create a new model file to store your EER diagram.
- Click "Create a new EER Model from existing database"
- Select the configured database connection
- Fill in the database name to import (default is the current database in the connection)
After this step is completed, the tool will start loading the database structure, including all tables, fields, indexes, foreign keys and other information.

Reverse engineering to generate EER diagrams
Next, we will enter the "Reverse Engineer" process, which is the core part of the entire operation.
- Connect to the database : Confirm that the correct connection configuration is used.
- Select the object to import :
- You can select all tables or manually check a few specific tables
- Objects such as views, stored procedures, etc. can be selected as needed
- Generate model : After clicking "Execute", the system will automatically analyze the database structure and generate the corresponding EER diagram.
During this process, if there are no foreign key constraints between certain tables, the EER graph may not automatically generate an association line. At this time, you need to manually adjust or supplement foreign key relationships.
View and adjust EER charts
After the generation is complete, you will see a visual chart showing the relationship between the tables. you can:
- Drag the table to retype it to make the structure clearer
- Double-click the table to view field details, indexes, foreign keys, etc.
- Add comments or graphic descriptions to facilitate understanding when teamwork
Sometimes too many tables can cause confusion in the chart. You can consider exporting them in modules, or just select a few associated forms to model separately.
If you find that some relationships are not displayed, check whether foreign key constraints are set. EER diagrams rely on foreign keys to establish connections. If there are no foreign keys, you need to manually add relationship lines.
Export and share EER pictures
After editing, you can export the EER image as an image or PDF file for easy sharing or archive.
- Click File > Export > Export as PNG or PDF in the menu bar
- Set the save path
In addition, you can save the entire model file (.mwb format) and continue to edit it after opening it next time.
Basically these steps. Although it seems a bit too many, the whole process is actually very fast after getting familiar with it. The key is to ensure that there is a good foreign key design in the database so that the generated EER diagram is accurate and valuable for reference.
The above is the detailed content of Create EER diagram from existing database mysql workbench. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

JSON data can be saved into a MySQL database by using the gjson library or the json.Unmarshal function. The gjson library provides convenience methods to parse JSON fields, and the json.Unmarshal function requires a target type pointer to unmarshal JSON data. Both methods require preparing SQL statements and performing insert operations to persist the data into the database.

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

Using the database callback function in Golang can achieve: executing custom code after the specified database operation is completed. Add custom behavior through separate functions without writing additional code. Callback functions are available for insert, update, delete, and query operations. You must use the sql.Exec, sql.QueryRow, or sql.Query function to use the callback function.

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.
