Before I start and explain how to create a database for MySQL using MySQL Workbench, let me tell you what is MySQL Workbench. MySQL Workbench is a visual tool used to view your database. MySQL Workbench has administration tools that enables you to configure your Server, also enables you to make backups and restore your databases. MySQL Workbench is used by developers and Database Administrators to administer their environment. The SQL Editor within MySQL Workbench allows you to create and execute SQL queries on your databases.
Fun fact about MySQL: MySQL is named after its co-founder's daughter called 'My'.
Now, how to start to create a database for MySQL using MySQL Workbench. Before you can start with the following steps, you need MySQL installed and configured on your local with an user account that has full access to your environment.
Double click on your instance, the following view will be available.
Before we go to the next step, MySQL databases are also called Schemas. In MySQL, Schema is identical to a database. When you want to create a MySQL Database using a SQL query, you will use CREATE SCHEMA instead of CREATE DATABASE. If you look at SQL Server, a schema contains a group of tables and a database contains a group of schemas but within MySQL, it is the same thing. Now, to create a MySQL Database/Schema, search for the heading SCHEMAS in you left panel, right click, a menu will appear, then click on Create Schema:
The next step will ask you to complete the Database/Schema Name. When done, click on Apply.
When you click on Apply on the previous step, MySQL Workbench will generate a SQL script for you to that will be executed to create your database. Find below an example of the SQL Script:
To run the SQL Script and create your database, click on Apply. After the SQL Script executes, you will find your new database under SCHEMAS on the left panel. Your next step will be to create a SQL Table, click on URL How to create a SQL Table in MySQL using MySQL Workbench for a step by step guide.
Another fun fact about MySQL: To allow access to only localhost/127.0.0.1, you can use skip-networking option in the config file. By enabling it, you will not be able to access your MySQL environment from the Public. The bind-address must be set to 127.0.0.1 to allow localhost and ignore all other TCP ports.





: