How to view and edit table and column comments with MySQL Workbench

MySQL, like most databases, allows you to add comments to each table and column. If used, this is useful for understanding database schema and meaning of data elements.

In this tutorial, I would like to show you how to view and edit table and column comments with MySQL Workbench - a free MySQL development and management tool from Oracle.

Viewing comments

Let's start with finding existing comments. I assume you are already connected to your database and schema and found a list of tables (lower left side of the screen below). To view comments for a specific table, click right mouse button and choose Table Inspector option. It will open a new tab in main pane (right-hand side of the screen).

Comment assigned to your table will be visible at the bottom of the first tab called Info, along with other table metadata.

To view comments for columns go to Columns tab, and comments will be visible in the last column in the grid.

Editing comments

If in the last step you didn't see any comments it's probably because there were none entered. Why not do it now?

To edit comments in the specific table, you need to enter into edit mode. Select table, click right mouse button and choose Alter table... option. It will open a new tab in the main pane (right-hand side of the screen) with the editor.

You can edit table description in Comments field on the top (blue rectangle).

To change column comment you need to first select a column from the grid in the middle of the form (it's attributes will appear at the bottom of the form) and you will be able to edit commetns in the Comments field (green rectangle).

Make sure to save changes with the Apply button. Make sure you didn't make any other unwanted changes as any change to the schema will also be applied to the database.

Bonus: Share database schema with comments in HTML

Exploring schema of MySQL database and reading comments in is not most convenient with MySQL Workbench. I have good news, you can easily extract schema and share in convenient, searchable HTML documentation in minutes with Dataedo. Here is a sample documentation:

See live sample

Try it yourself for free now

Comments are only visible when the visitor has consented to statistics cookies. To see and add comments please accept statistics cookies.
0
There are no comments. Click here to write the first comment.