How to Create a Database in MySQL Workbench using the GUI

To create a database in the MySQL Workbench GUI:

  1. Click the “new schema” button on the MySQL Workbench toolbar
  2. Enter a schema name (database name) and its default collation and click Apply
  3. Review the SQL statement and click Apply

The database will now be created, and a message will display advising that the script was successful.

Below are screenshots for the above steps.

The New Schema Button

Click the “new schema” button on the MySQL Workbench toolbar:

Screenshot of the Create Schema button on the MySQL Workbench toolbar
The “Create Schema” button on the MySQL Workbench toolbar.

Enter a Name & Default Collation

Enter a schema name (database name) and its default collation and click Apply:

Screenshot of the New Schema dialog in MySQL Workbench.
The “New Schema” dialog. Enter the schema name (database name) and its default collation.

Create the Database

Review the SQL statement and click Apply:

Screenshot of the Apply SQL Script to Database screen
This screen allows you to review the script generated by MySQL before applying it.

The following message will be displayed if the script has run successfully:

Screenshot of the Success message
The “Success” message when the script has run successfully.

You will now be able to see the database under SCHEMAS in the left navigation pane.

The above steps create a blank database. You will need to add tables and other database objects before you can add data.

Setting the Database as the Default Schema

You can set the new database as the default schema if you wish. Simply right click on the database name and select Set as Default Schema:

Screenshot of setting the default schema.
Setting the database as the Default Schema.

By doing this, any scripts that don’t specify a database will run against this one.

You can tell which database is the default one because it is bolded.