MySQL ER diagram generator
Paste the output of mysqldump --no-data and get an interactive ER diagram — backticks, AUTO_INCREMENT, inline COMMENT and foreign keys all read. No Workbench to install, no connection to open, nothing uploaded.
A real dump, ENGINE trailers and all. Paste yours over it.
Two steps, and neither is an install
- 01
mysqldump --no-data mydb > schema.sql. Not one row leaves the server —--no-dataexports the structure only, which is both faster and the version you can safely paste anywhere. - 02Paste the dump into the panel above, or drop the file onto it. The diagram appears as the schema is read; switch to Data Dictionary for the printable version, or export PNG, SVG, Mermaid, DBML or PlantUML.
What a mysqldump file actually contains
A dump is not a tidy list of CREATE TABLE statements. It is wrapped in machinery, and a parser that trips on any of it is no use on real files:
- Backticks everywhere — every identifier is quoted, including the ones that never needed it.
- Trailers on every table —
ENGINE=InnoDB,DEFAULT CHARSET=utf8mb4,COLLATE, and a table-levelCOMMENTthat becomes a description in the dictionary. - Conditional comments —
/*!40101 SET ... */blocks that are executable on MySQL and noise to everyone else. Recognized and skipped, not reported as errors. - Keys written three ways —
PRIMARY KEYincluding composite ones (the reactions table in the example dump has one),UNIQUE KEYandKEYfor indexes, andCONSTRAINT … FOREIGN KEY … REFERENCESfor relations. - MySQL’s own spellings —
bigint unsigned,tinyint(1)standing in for a boolean,datetimeandmediumtext, kept as written rather than flattened into a generic type.
When the dump declares no keys
Laravel and Rails projects frequently enforce relationships in application code and never add a database-level foreign key, so their dumps arrive as a set of unconnected tables. The column names still say what points where: a thread_id belongs to threads. Those relations are drawn as dashed lines and counted separately, so the diagram is readable without ever claiming the database declares something it does not — and a single switch hides them if you only want what the schema states outright.
ErdDocs reads the dump in a browser tab; Workbench is a desktop install
ErdDocs starts from the file, so it reaches the cases a live connection cannot: a dump attached to a ticket, a schema in a code review, a client’s file on a laptop that will never have their database password, or an afternoon when installing a desktop application to read one file for five minutes is a poor trade. MySQL Workbench holds the other half of the job — with credentials in hand it reverse-engineers the server itself into an EER diagram and lets you edit the model afterwards.
ErdDocs also hands you the document, not only the picture. The same paste produces a data dictionary — every table, column, type, default, index and relation as one printable reference — which is what an auditor or a new teammate actually asks for.
FAQ
Do I need MySQL Workbench?
No. ErdDocs reads the text of a dump, which is what you actually have when the schema arrived in a ticket, a CI artifact or an email from a client — paste it and the diagram is there. Workbench is the official answer and a good one, its reverse-engineering wizard building an EER diagram straight from a server; it is also a desktop application to install and keep updated, where ErdDocs is a browser tab that needs no account and turns the same dump into a printable data dictionary.
Which command produces the file to paste?
mysqldump --no-data mydb > schema.sql. The --no-data flag means not a single row is exported: you get CREATE TABLE statements and nothing else, which is both faster and the only version safe to paste anywhere. A dump made with data works too — the INSERT statements are skipped — but there is no reason to hand around your rows.
What does it read from a mysqldump file?
Backticked identifiers, AUTO_INCREMENT, unsigned integer types, inline COMMENT on both columns and tables, DEFAULT values, PRIMARY KEY and composite keys, UNIQUE KEY and KEY index definitions, and CONSTRAINT ... FOREIGN KEY ... REFERENCES clauses. The noise mysqldump wraps around them — ENGINE=InnoDB, DEFAULT CHARSET, /*!40101 conditional comments, SET statements — is recognized and ignored rather than treated as an error.
My dump has no foreign keys at all — Laravel and Rails often skip them.
Then ErdDocs recovers the relations from column naming, so a user_id column links to the users table, and draws those lines dashed so you can always tell them from keys the database declares. It is the difference between a wall of disconnected boxes and a readable diagram, and the drawing never claims the database says something it does not.
Is my schema uploaded anywhere?
No. ErdDocs parses the dump in JavaScript, in your browser: it is read on your own machine and never sent to a server. That matters more for a schema than people expect — table and column names are exactly what an attacker wants for reconnaissance, and what an NDA usually covers.
Is it free?
Diagrams up to 25 tables render in full for free, with no account, and the PNG, SVG, Mermaid, DBML and PlantUML exports are free too. Larger schemas are parsed completely — the tables past the limit appear as locked placeholders — and $9 once lifts the limit and unlocks the data dictionary.
Related
- MySQL data dictionary generator — the same dump as a printable document.
- PostgreSQL data dictionary generator — pg_dump idioms, COMMENT ON, partitions.
- SQL to PlantUML — the same schema as text for a UML toolchain.
- Mermaid ER diagram generator — the same schema as README text.
- ER diagram tool — the same generator against the drawing suites, for any database.
- Database diagram tool — the broader term, and why it reads a dump instead of connecting.
- Example schemas — eleven domains with the SQL to paste.
- SQL to ER diagram — the tool with every format it reads.