Export database structure


Is there a way to export only the structure of database tables, for example, to HTML?
Similar to how phpMyAdmin or adminer does it.



Yes, PhpStorm provides a way to export the structure of database tables. You can use the "Export Database Schema" feature to achieve this. Here are the steps:

  1. Open the "Database" tool window in PhpStorm.
  2. Select the database for which you want to export the structure.
  3. Right-click on the database and select "Export Database Schema" from the context menu.
  4. In the "Export Database Schema" dialog box, select the format as "HTML" and choose the location to save the exported file.
  5. Click on the "Export" button to start the export process.

Once the process is completed, you can open the exported HTML file to view the database structure.

I hope this helps. Let me know if you have any further questions.

Thank you.


Unfortunately, I don't see "Export Database Schema" in my context menu. Can this be affected by the version of PhpStorm (current 2022.3.2), or the database (MariaDB 10.5.18)? There is only "Import/Export", but I didn't find the right one here either.


Sorry, misplaced the options.

There are two ways:

1. In context menu Diagrams | Show Visualisations. The diagram can later be exported to PlantUML/Meramid, but not to HTML:

2. In context menu click "SQL scipts | Copy DDL to Clipboard". DDL is not HTML, but contains all the info about table/database as a text.

3. There is a way to create a custom exporter, but it's a bit complex

Can you share your use case? Why HTML is needed?


It is the tabular representation that is more important, as it seems to me, it is more convenient for perception, and is required in technical documents. And whether it will be HTML or CSV is not so important.

Right now I'm using "Generate DLL" and then inserting it into Adminer to get the table.

Thank you for your response, I will think about custom exporter.


Please sign in to leave a comment.