When you first open MySQL Workbench a default schema,
mydb
appears as the left-most tab of the
Physical Schemata section of MySQL Workbench. You
can begin designing a database by using this default schema.
To change the name of the default schema, double-click the schema tab. This opens a schema editor window docked at the bottom of the application. To undock or redock this window, simply double-click anywhere in the editor title bar.
To rename the schema, use the text box labeled Name. Once you have renamed the schema a lightning bolt icon appears right aligned in the Name text box, indicating that other changes are pending. Click the Comments text area and a dialog box opens asking if you wish to rename all schema occurrences. Clicking ensures that your changes are propagated throughout the application. Add comments to the database and change the collation if you wish. Close the schema editor by clicking the button.
Create a new table by double-clicking the Add
Table icon in the Physical
Schemata
panel. Doing this opens the table editor
docked at the bottom of the application. If you wish, you can
undock or dock this editor in exactly the same way as the schema
editor window.
Use the first tab of the table editor to change the name, collation, and engine. You may also add a comment.
Add columns to the new table by selecting the Columns tab. Use the default column name or enter a new name of your choosing. Use the Tab key to move to the next column and set the column's data type.
Altering the table by adding indexes or other features is also easily done using the table editor.
Additional objects such as views or routines can be added in the same way as tables.
Any objects you have created can be found in the Catalog palette on the right. To view these schema objects select the Catalog tab in the middle palette on the right. View all the objects by clicking the button to the left of the schema name.
Save your changes to a MySQL Workbench Models
file (mwb) by choosing from the
menu or by using the keyboard command
Ctrl S.