w3resource logo


MySQL Tutorial

MySQL workbench tutorial

Secondary Nav

What is MySQL workbench

MySQL Workbench is GUI based tool to work with MySQL Servers. You may use this for Server Administration, for creating Entity Relationship Diagrams and for SQL Development (run queries etc).

This tutorial discusses how to perform basic MySQL Administration tasks using MySQL Workbench.

Installing MySQL workbench

To install MySQL Workbench on Linux (we used Ubuntu), you may run the following command from your terminal.

sudo apt-get install MySQL-workbench

MySQL Workbench version installed at the time of writing this tutorial is 5.2.40.

On Windows, if you are installing MySQL Community Server 5.6, MySQL Workbench is installed in the installation process of the server itself. Download the appropriate .msi file from the MySQL download page, run it and follow the instructions.

After installing it successfully, when you start, you get a window like following.

Pictorial presentation of when you open MySQL Workbench

workbench whole

You may see that there are three sections - SQL Development, Data Modelling, and Server Administration.

Create a new database connection

The following slideshow shows you how to create a new connection using MySQL Workbench.

  • MySQL Workbench New Connection Step 1
  • MySQL Workbench New Connection Step 2
  • MySQL Workbench New Connection Step 3
  • MySQL Workbench New Connection Step 4
  • MySQL Workbench New Connection Step 4

Create Database and table

Once the connection is created, you may use that connection to enter SQL Editor to do SQL Development tasks like creating/modifying/deleting modify database and tables, running SQL queries etc.

  • MySQL Workbench create database Step 1
  • MySQL Workbench Create database Step 2
  • MySQL Workbench Create database Step 3
  • MySQL Workbench Create database Step 4

Edit table data

With MySQL Workbench you can select a connection, a schema and table under that to edit table data.

  • MySQL Workbench Edit table data step 1
  • MySQL Workbench Edit table data step 2
  • MySQL Workbench Edit table data step 3

Edit SQL Scripts

Click on Edit SQL Scripts to edit an existing SQL script.

  • MySQL Workbench Edit sql script step 1
  • MySQL Workbench Edit sql script step 2

Manage Connections

You can manage existing connections using MySQL Workbench.

MySQL Workbench Manage Connections

Click on Manage Connections using the link and then from the windows as shows above, you can create a new connection, delete an existing connection, create a clone of an existing connection and change parameters like name, method, username, port, password, default schema etc. of an existing connection.

Data Modelling

Using this section, you can create a new Entity Relationship models using various components available, creating EER from an existing database, from a SQL Script and open an existing one.

The following slideshow shows how to create an EER from an existing database.

  • MySQL Workbench eer step 1
  • MySQL Workbench eer step 2
  • MySQL Workbench eer step 3
  • MySQL Workbench eer step 4
  • MySQL Workbench eer step 5
  • MySQL Workbench eer step 5
  • MySQL Workbench eer step 6
  • MySQL Workbench eer step 7

Server Administration

You can create new Server Instance and manage existing Server Instances on one hand and on the other you can manage security, that is creating and managing user and provide them with permissions to perform various tasks on MySQL objects and manage import and export data and structure.

Manage Security

  • MySQL Workbench user privileges step 1
  • MySQL Workbench user privileges step 2
  • MySQL Workbench user privileges step 3
  • MySQL Workbench user privileges step 4
  • MySQL Workbench user privileges step 5

Import & Export

  • MySQL Workbench Export
  • MySQL Workbench Import

We have covered the basic tasks you can perform with MySQL Workbench in this tutorial. Hopefully, this will be helpful to you and get you started with MySQL Administration.



Join our Question Answer community to learn and share your programming knowledge.

Help the community:

Python: Fizzbuzz

C++: Decimal to binary conversion

JavaScript: Need Help in JavaScript

Python: Help me with this program