ErdDocs

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 are all read. No Workbench to install, no connection to open, nothing uploaded.

Your schema

A real dump, ENGINE trailers and all. Paste yours over it.

Two steps, and neither is an install

  1. 01mysqldump --no-data mydb > schema.sql. Not one row leaves the server. --no-data exports the structure only, which is both faster and the version you can safely paste anywhere.
  2. 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-level COMMENT that becomes a description in the dictionary.
  • Conditional comments. /*!40101 SET ... */ blocks are executable on MySQL and noise to everyone else. Recognized and skipped, not reported as errors.
  • Keys written three ways. There is PRIMARY KEY, including composite ones (the reactions table in the example dump has one). UNIQUE KEY and KEY mark indexes, and CONSTRAINT … FOREIGN KEY … REFERENCES marks relations.
  • MySQL’s own spellings: bigint unsigned, tinyint(1) standing in for a boolean, datetime and mediumtext, 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. The dashed style keeps them apart from keys the database declares. If you only want what the schema states outright, a single switch hides them.

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. That includes a dump attached to a ticket, a schema in a code review, or a client’s file on a laptop that will never have their database password. It also covers the afternoon when installing a desktop application to read one file for five minutes is a poor trade. MySQL Workbench needs that install, plus credentials for the server it reads.

ErdDocs also gives you the document. The same paste produces a data dictionary: every table, column, type, default, index and relation as one printable reference. It is what an auditor or a new teammate asks for.

FAQ

Do I need MySQL Workbench?

No. ErdDocs reads the text of a dump. That 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 a desktop application that builds an EER diagram from a server you connect it to. ErdDocs is a browser tab that needs no account, and it 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, since 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. mysqldump also wraps them in noise: ENGINE=InnoDB, DEFAULT CHARSET, /*!40101 conditional comments, SET statements. That noise is recognized and ignored.

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. Those lines are drawn dashed, so you can always tell them from keys the database declares. Without them the diagram would be a wall of disconnected boxes.

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. Table and column names are 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, and the tables past the limit appear as locked placeholders. Paying $9 once lifts the limit and unlocks the data dictionary.

Related