ERD Diagrams | MySQL Database Design and Docs with DbSchema



DbSchema connects to a MySQL database, reverse-engineers it into an interactive ER diagram, and keeps the model in a local file that versions in Git. From that model it generates interactive HTML5 documentation, synchronizes schema changes back to the server, browses related rows across foreign keys, and generates sample data.

Connecting, reverse-engineering and the interactive diagrams are in the free Community Edition. Saving the model to a file, HTML5 documentation, the visual query builder, schema synchronization, relational data browse and the data generator are Pro.

The sections below walk through each step against a live MySQL database, in the order you would actually do them.

Why Use DbSchema with MySQL?

DbSchema reads a MySQL schema and renders it as an editable ER diagram, so structure changes are made on the diagram and written back as SQL. If you are looking for theoretical guidance on entities, attributes, and normalization before you build, see our guide on logical database design.

For a quick summary, skip to Key Features - or dive into the full guide below to see all that DbSchema offers for MySQL:

Connect DbSchema to a MySQL database

Connecting DbSchema to MySQL is simple. To get started, you just need your MySQL server’s host address, port, and login credentials (username and password).

For a detailed, step-by-step guide on how to connect DbSchema to MySQL, please refer to the official documentation.

Once connected, DbSchema will instantly reverse-engineer your database and you can start designing and exploring.

MySQL Connection Dialog

Reverse-engineer a MySQL schema into a MySQL database diagram

DbSchema’s diagrams let you easily see tables, columns, and relationships.

  • Tables and Columns: Diagrams display tables with columns, data types, and constraints, providing a clear structure for users to understand.
  • Relationships: Connections between tables (foreign keys) are visually represented, helping users grasp the data flow and interdependencies.

MySQL Database Diagram

FeatureDescriptionVisual Aid
Easy Connection with MySQLQuickly connect to MySQL by entering your credentials. DbSchema will automatically reverse-engineer your database.Connection View
Visualizing Database StructureCreate and view Entity-Relationship Diagrams (ERDs) that display tables, columns, data types, constraints, and relationships.Diagram View
Interactive HTML5 DocumentationGenerate interactive documentation that lets users navigate through tables, columns, constraints, and relationships.HTML5 Doc View
Collaborate with Git IntegrationTrack schema changes with Git integration, enabling version control and collaborative schema management.Git Integration View
Advanced Query Building and SQL EditingBuild complex queries visually with the query builder or use the integrated SQL editor with syntax highlighting and real-time execution.Query Builder View
Automated SynchronizationSync changes from your MySQL database to DbSchema, allowing you to create, drop, or modify tables and other schema objects.Synchronization View
Relational Data EditorEdit and explore MySQL data in real-time, viewing relationships between tables as you make changes.Relational Data Editor View
Sample Data with the Data GeneratorPopulate your MySQL tables with sample data. Configure a generator per column first - the stock generators do not respect declared varchar lengths.Data Generator View

Key DbSchema features for MySQL at a glance

Interactive HTML5 documentation for MySQL

DbSchema enables you to create interactive HTML5 documentation, making it easy to navigate complex databases. This documentation is valuable for anyone who needs to explore the database structure without requiring direct access.

  • Interactive Table Details: Users can click on tables to explore columns, constraints, and foreign keys and read comments, which promotes deeper understanding.
  • Relational Navigation: Foreign keys are clickable, allowing users to trace relationships and understand the schema more intuitively, facilitating quick navigation and analysis.

HTML5 Documentation

Version the MySQL model with Git

DbSchema’s GIT integration helps track schema changes, so documentation stays up-to-date with each modification.

  • Version Control: Keep a record of updates to tables, columns, and foreign keys, ensuring historical context is available.
  • Collaboration: Enable multiple users to work on the schema and keep documentation current, fostering teamwork and accountability.

Version control inside DbSchema helps ensure that your team stays on the same page, making it easier to manage changes over time.

MySQL GIT Integration

MySQL database designer: Visual query builder and SQL editor

DbSchema Database Designer

DbSchema also queries the data, not only the structure.

  • Visual Query Builder: Create complex SQL queries without writing any code. Just drag and drop tables and fields to build your query visually.
  • SQL Editor: For those who prefer coding, the integrated SQL editor offers syntax highlighting, auto-completion, and real-time query execution.

Build queries by dragging tables onto the visual query builder, or type them in the SQL editor with schema-aware autocomplete. The SQL editor is in the free Community Edition; the visual query builder is Pro.

Query Builder

Synchronize the model with a live MySQL database

  • Schema Synchronization: DbSchema can automatically sync changes from your MySQL database, ensuring that your visual schema, queries, and data exploration are always up to date.
  • Create, Drop, or Modify Objects: During synchronization, DbSchema gives you the flexibility to create or drop the tables, or modify columns, relationships, indexes, and constraints to match the latest schema changes in MySQL.
  • Work Offline and Sync Later: You can work offline in DbSchema, creating tables or making modifications in your design model without the need to stay connected to your MySQL database. Once you're ready to synchronize, simply reconnect to your database. DbSchema will allow you to compare your design model with the live database and refresh it, highlighting any discrepancies or differences.
  • Scheduled Syncs: You can schedule regular synchronizations to ensure your schema and data are always current, reducing discrepancies between your design and the live MySQL database.

Synchronization Dialog

Relational data editor for MySQL

The Relational Data Editor in DbSchema allows you to interact with your MySQL data directly, providing a hands-on way to manage and explore relationships between your tables.

  • Edit Data: Modify data directly in your MySQL database to see changes in real-time, making it easy to experiment and test different data scenarios.
  • View Relationships: As you navigate through your MySQL tables, DbSchema visually highlights the relationships between them, giving you a clear view of how data is connected and how changes in one table may affect others.

This interactive approach lets you work more efficiently with your MySQL data, offering a dynamic and visual way to manage and understand data interdependencies.

Relational Data Editor

Generate MySQL sample data

Including sample data is a great way to understand how your MySQL tables and columns function. DbSchema’s Data Generator populates your tables with sample data. Configure a generator per column before you run it - the stock generators do not respect declared varchar lengths, and a run over an ordinary schema fails on the first oversized value.

  • Column Examples: Automatically generate real or mock data for each column, helping you visualize how different types of data interact within your MySQL tables.
  • Relationship Samples: Populate related tables with sample data to demonstrate how information flows through relationships, giving you a better understanding of how different tables interact in your MySQL database.

Data Generator

FAQ

Does DbSchema support MySQL reverse engineering?

Yes, DbSchema can connect to your MySQL database and instantly reverse-engineer the schema, mapping out tables, columns, and relationships in a visual diagram automatically.

Conclusion

DbSchema covers the MySQL workflow end to end: connect and reverse-engineer the schema into an ER diagram, edit the model offline, synchronize it back to the live database, browse related rows in the Relational Data Editor, and export interactive HTML5 documentation.

Download DbSchema and connect it to your MySQL database. The free Community Edition covers connecting, reverse-engineering and the interactive diagram; schema synchronization, HTML5 documentation, Git collaboration, the Relational Data Editor and the Data Generator are Pro.

Design your MySQL schema visually

DbSchema reverse-engineers a MySQL database into an interactive ER diagram, synchronizes the model back to the server, and exports interactive HTML5 documentation.

DbSchema Design your database visually - free

DbSchema ER Diagram Download free
Visual Design & Schema Diagram

✓ Create and manage your database schema visually through a user-friendly graphical interface.

✓ Easily arrange tables, columns, and foreign keys to simplify complex database structures, ensuring clarity and accessibility.

GIT & Collaboration
Version Control & Collaboration

✓ Manage schema changes through version control with built-in Git integration, ensuring every update is tracked and backed up.

✓ Collaborate efficiently with your team to maintain data integrity and streamline your workflow for accurate, consistent results.

Data Explorer & Query Builder
Relational Data & Query Builder

✓ Seamlessly navigate and visually explore your database, inspecting tables and their relationships.

✓ Build complex SQL queries using an intuitive drag-and-drop interface, providing instant results for quick, actionable insights.

Interactive Documentation & Reporting
HTML5 Documentation & Reporting

✓ Generate HTML5 documentation that provides an interactive view of your database schema.

✓ Include comments for columns, use tags for better organization, and create visually reports.