MySQL Workbench Tutorial: What is, How to Install & Use (2023)

What is MySQL?

MySQL is an open source relational database.

MySQL is cross platform which means it runs on a number of different platforms such as Windows, Linux, and Mac OS etc.

In this MySQL Workbench tutorial, you will learn-

  • What is MySQL?
  • Why use MySQL?
  • Introducing MySQL Workbench
  • MySQL workbench- Modeling and Design tool
  • MySQL workbench – SQL development tool
  • How To Use MySQL Workbench – Administration tool
  • Install MySQL workbench Guide

Why use MySQL?

There are a number of relational database management systems on the market.

Examples of relational databases include Microsoft SQL Server, Microsoft Access, Oracle, DB2 etc.

One may ask why we would choose MySQL over the other database management systems.

The answer to this question depends on a number of factors.


Let’s look at the strengths of MySQL compared to over relational databases such as SQL Server

  • MySQL supports multiple storage engines each with its own specifications while other systems like SQL server only support a single storage engine. In order to appreciate this statement, let’s look at two of the storage engines supported by MySQL.
  • InnoDB: – its default storage engine provided with MySQL as of version 5.5. InnoDB supports foreign keys for referential integrity and also supports ACID-standard transactions.
  • MyISAM: – it was the default storage engine for MySQL prior to version 5.5. MyISAM lacks support for transactions. Its advantages over InnoDB include simplicity and high performance.
  • MySQL has high performance compared to other relation database systems. This is due to its simplicity in design and support for multiple-storage engines.
  • Cost effective, it’s relatively cheaper in terms of cost when compared to other relational databases. In fact, the community edition is free. The commercial edition has a licensing fee which is also cost effective compared to licensing fees for products such as Microsoft SQL Server.
  • Cross platform – MySQL works on many platforms which means it can be deployed on most machines. Other systems such as MS SQL Server only run on the windows platform.

In order to interact with MySQL, you will need a server access tool that can communicate with MySQL server. MySQL supports multiple user connections.

What is MySQL Workbench?

MySQL Workbench is a Visual database designing and modeling access tool for MySQL server relational database. It facilitates creation of new physical data models and modification of existing MySQL databases with reverse/forward engineering and change management functions. The purpose of MySQL workbench is to provide the interface to work with databases more easily and in a more structured way.

(Video) MySQL Workbench Tutorial | Introduction To MySQL Workbench | SQL Basics For Beginners | Simplilearn

MySQL Workbench Tutorial: What is, How to Install & Use (1)

MySQL workbench- Modeling and Design Tool

  • Models are at the core of most valid and high performance databases. MySQLworkbench has tools that allow developers and database administrators visually create physical database design models that can be easily translated into MySQL databases using forward engineering.
  • MySQL workbench supports creation of multiple models in the same environment.
  • It supports all objects such as tables, views, stored procedures, triggers, etc. that make up a database.
  • MySQL workbench has a built in model validating utility that reports any issues that might be found to the data modeler.
  • It also allows for different modeling notations and can be extended by using LUA a scripting language.

The figure shown below shows the modeling window for MySQLWorkbench.

MySQL Workbench Tutorial: What is, How to Install & Use (2)

MySQL workbench – SQL development tool

Structured Query Language (SQL) allows us to manipulate our relational databases. SQL is at the heart of all relational databases.

  • MySQLworkbench, has built in SQL visual editor.
  • The Visual SQL editor allows developers to build, edit and run queries against MySQL server databases. It has utilities for viewing data and exporting it.
  • Its syntax color highlighters help developers easily write and debug SQL statements.
  • Multiple queries can be run and results automatically displayed in different tabs.
  • The queries are also saved in the history panel for later retrieval and running.

The figure shown below shows the SQL development window for MySQL Workbench.

MySQL Workbench Tutorial: What is, How to Install & Use (3)

How To Use MySQL Workbench – Administration tool

Server administration plays a critical role in securing the data of the company. The major issues concerning server administration are users’ management, server configuration, server logs and many more. Workbench MySQL has the following features that simplify the process of MySQL server administration;

  • User administration – visual utility for managing users that lets database administrators easily add new and remove existing users if need arises, grant and drop privileges and view user profiles.
  • Server configuration – allows for advanced configuration of the server and fine tuning for optimal performance.
  • Database backup and restorations – visual tool for exporting/importing MySQL dump files. MySQL dump files contain SQL scripts for creating databases, tables, views, stored procedures and insertion of data.
  • Server logs – visual tool for viewing MySQL server logs. The logs include error logs, binary logs and InnodDB logs. These logs come in handy when performing diagnosis on the server. The figure shown below shows the modeling window for MySQL Workbench.

The figure shown below shows the Admin panel for Workbench MySQL.

MySQL Workbench Tutorial: What is, How to Install & Use (4)

How to Install MySQL workbench (for Windows)

In this MySQL Workbench tutorial for beginners, we will learn how to install and use MySQL Workbench.

Install MySQL workbench is a 2 step process.

(Video) How To Install MySQL (Server and Workbench)

1) Install MySQL Community Server

2) Install MySQL workbench – You can install the workbench using a zip file or an msi installer (recommended)

Note: You will require Administrator or Power User Privileges to perform installation.

Getting Started

Once you have finished installing above you need to set up MySQL Workbench as shown below-
Following is a step by step process on How to Install MySQL workbench.

Step 1) Open Home Window
First step is launching the Workbench MySQL. What you see is called Home Window

MySQL Workbench Tutorial: What is, How to Install & Use (5)

Step 2) Open New Connection Wizard
Next you need to create your MySQL Server Connection which contains details about target database server including how to connect to it. Click ” + “ in MySQL Workbench Home Window. This will open Setup New Connection. Wizard

MySQL Workbench Tutorial: What is, How to Install & Use (6)

Step 3) Click Configure Server Management button
As a beginner you can create a connection for a locally installed server. Click Configure Server Management button in Setup New Connection window to check the cofiguration of the MySQL server.

(Video) Install MySQL Server and Workbench | MySQL Workbench Installation on Windows 10 | Simplilearn

MySQL Workbench Tutorial: What is, How to Install & Use (7)

Step 4) Click Next button to continue
A new window opens named Configure Local Management. Click Next button to continue.

MySQL Workbench Tutorial: What is, How to Install & Use (8)

Step 5) Enter your password and press OK
Next the Wizard will test connections to database. If test fails, go back and correct database connection parameters.5. Next it will open a pop up window asking your root password to test your connection with the local mysql server instance. The password is the one you set during installation of MySQL Workbench. Enter your password and press OK

MySQL Workbench Tutorial: What is, How to Install & Use (9)

Step 6) Click Next to continue
Next the Wizard will test connections to database. If test fails, go back and correct database connection parameters. Else if all tests are sucessful click Next to continue.

MySQL Workbench Tutorial: What is, How to Install & Use (10)

Step 7) Click Next
After that a new wizard will open about Local Service Management – It lets you switch between multiple mysql severs installed on one machines. As a beginner you can bypass this and click Next to continue.

MySQL Workbench Tutorial: What is, How to Install & Use (11)

Step 8) Select MySQL Server Configuration File
The Wizard will then check ability to access MySQL Server Configuration File, and test start/stop commands.

MySQL Workbench Tutorial: What is, How to Install & Use (12)

(Video) MySQL Workbench Tutorial


Step 9) Click Finish to finsh server cofiguration
Next you can review current configurations. After reviewing the configurations, Click Finish to finsh server cofiguration

MySQL Workbench Tutorial: What is, How to Install & Use (13)

Step 10) Click on Test Connection
Next Step is to setup a connection, which can be used to connect to server. If you have not created a connection already, you can use the default values given. Click on Test Connection [ 2 ] after entering the Connection Name [ 1 ].

MySQL Workbench Tutorial: What is, How to Install & Use (14)

Step 11) Click OK
A new dialog box will open asking you password to root/selected user. If your MySQL root user has a password, you can enter that using Store in Vault feature. Click OK.

MySQL Workbench Tutorial: What is, How to Install & Use (15)

If the entered password for the user is correct then the following screen will show. Click on both OK buttons and you will be good to go.

MySQL Workbench Tutorial: What is, How to Install & Use (16)

A new instance is shown in the homepage.

MySQL Workbench Tutorial: What is, How to Install & Use (17)

Double click and start querying.

(Video) MySQL Workbench Tutorial

Summary

  • MySQL is an open source relational database that is cross platform.
  • MySQL supports multiple storage engines which greatly improve the server performance tuning and flexibility. Prior to version 5.5, the default storage engine was MyISAM which lacked support for transactions, as of version 5.5; the default storage engine is InnoDB which supports transactions and foreign keys.
  • MySQL server can be administered using a number of server access mysql tools which include both commercial and open source products. Popular examples include;
  • phpMyAdmin – cross platform web based open source server access tool
  • SQLYog – targeted at the windows platform, desktop commercial server access tool
  • MySQL workbench – cross platform open source server access tool
  • MySQL workbench is an integrated development environment for MySQL server. It has utilities for database modeling and designing, SQL development and server administration.

You Might Like:

  • What is ER Modeling? Learn with Example
  • What is Normalization in DBMS (SQL)? 1NF, 2NF, 3NF Example
  • Database Design in DBMS Tutorial: Learn Data Modeling
  • What is a Database? Definition, Meaning, Types with Example
  • MariaDB Tutorial: Learn Syntax, Commands with Examples

FAQs

MySQL Workbench Tutorial: What is, How to Install & Use? ›

Open MySQL Servers, select the server you want to install, and move it to the Products/Features to be installed window section. Now, expand Applications, choose MySQL Workbench and MySQL shell. Move both of them to 'Products/Features to be installed'.

How do I install and work on MySQL Workbench? ›

Open MySQL Servers, select the server you want to install, and move it to the Products/Features to be installed window section. Now, expand Applications, choose MySQL Workbench and MySQL shell. Move both of them to 'Products/Features to be installed'.

What is MySQL Workbench What is it used for? ›

What is MySQL Workbench? MySQL Workbench is a unified cross-platform, open-source relational database design tool that adds functionality and ease to MySQL and SQL development work. MySQL Workbench provides data modeling, SQL development, and various administration tools for configuration.

How to use MySQL with MySQL Workbench? ›

Connect To Your Database Remotely
  1. Open MySQL Workbench.
  2. In the bottom left of the page, click on New Connection.
  3. Enter your database connection credentials in the Set up a New Connection dialog box. ...
  4. Click Test Connection.
  5. If you see the message “Connection parameters are correct,” click Ok.
Mar 24, 2023

What is difference between MySQL and MySQL Workbench? ›

MySQL allows you to handle, store, modify and delete data and store data in an organized way. SQL does not support any connector. MySQL comes with an in-built tool known as MySQL Workbench that facilitates creating, designing, and building databases.

How to write SQL commands in MySQL Workbench? ›

To do that, first select the desired database from the left column menu by double-clicking it. Then type in the MySQL query you want to run in the text field in the middle of the program window and use the yellow lightning button above that text field to run the query.

How do I start MySQL in workbench? ›

Configure MySQL Workbench
  1. Launch MySQL Workbench.
  2. Click the “+” symbol in the “MySQL Connections” tab to add a new connection.
  3. Configure the connection as follows: ...
  4. Click “Test Connection” to test the connection.
  5. If the connection is successful, click “OK” to save the connection.
Dec 21, 2022

How to create a database in MySQL Workbench? ›

Open the MySQL Workbench as an administrator (Right-click, Run as Admin). Click on File>Create Schema to create the database schema. Enter a name for the schema and click Apply. In the Apply SQL Script to Database window, click Apply to run the SQL command that creates the schema.

What are the prerequisites for workbench? ›

The minimum hardware requirements are: CPU: Intel Core or Xeon 3GHz (or Dual Core 2GHz) or equal AMD CPU. Cores: Single (Dual/Quad Core is recommended) RAM: 4 GB (6 GB recommended)

What is difference between SQL Workbench and MySQL Workbench? ›

MySQL workbench is specifically for MySQL, and written by the MySQL company, while SQL Workbench is a generic tool for multiple DBMS systems.

What is the difference between SQL and MySQL? ›

SQL and MySQL are database-related languages. While SQL is a programming language used to work with data in relational databases, MySQL is an open-source database product that implements the SQL standard.

Do I need to install MySQL before MySQL Workbench? ›

MySQL server: Although it is not required, MySQL Workbench is designed to have either a remote or local MySQL server connection. For additional information about connecting to a MySQL server, see Chapter 5, Connections in MySQL Workbench.

How to insert data in MySQL using workbench? ›

In order to start adding data to a table, right-click the table (in the SCHEMAS pane) to be modified and click Select Rows. You will then find yourself in a window that allows you to enter data (Figure E). In this window, you can either use the result grid or open the form editor.

How do we store data in a database? ›

The data in a database is grouped into a series of database records. Each database record is composed of smaller groups of data called segments. A segment is the smallest piece of data IMS can store.

Does MySQL Workbench have database? ›

To view the database created on MySQL Workbench, navigate to Database > Connect to Database . Choose an existing connection to connect to MySQL Server or create a new one. The database created will be as shown in the screenshot below.

Which software is used for MySQL? ›

MySQL, the most popular Open Source SQL database management system, is developed, distributed, and supported by Oracle Corporation.

What should I learn first SQL or MySQL? ›

Should I learn SQL or MySQL? To work on any database management system you are required to learn the standard query language or SQL. Therefore, it is better to first learn the language and then understand the fundamentals of the RDBMS.

What is MySQL with example? ›

MySQL is a relational database management system (RDBMS) developed by Oracle that is based on structured query language (SQL). A database is a structured collection of data. It may be anything from a simple shopping list to a picture gallery or a place to hold the vast amounts of information in a corporate network.

How do I create a table in SQL Workbench? ›

Create a Table
  1. Expand the database in which you want to create a table.
  2. The first item in the expanded menu should be Tables. ...
  3. Give your table a name.
  4. Double-click the empty white section under the table name to add columns.
  5. Define the column name, data type, and any constraints it may require.
Jan 29, 2020

What are the requirements for MySQL installation? ›

Installation Requirements

MySQL Installer requires Microsoft . NET Framework 4.5. 2 or later. If this version is not installed on the host computer, you can download it by visiting the Microsoft website.

What is the username and password for MySQL Workbench? ›

The default user for MySQL is root and by default it has no password. If you set a password for MySQL and you can't recall it, you can always reset it and choose another one.

How do I import a table into SQL Workbench? ›

To import a file, open Workbench and click on + next to the MySQL connections option. Fill in the fields with the connection information. Once connected to the database go to Data Import/Restore. Choose the option Import from Self-Contained File and select the file.

Can I use MySQL Workbench without server? ›

The answer is yes, you do. MySQL Workbench is a powerful graphical tool for database design and administration. It is a great tool for managing and developing databases, but it requires a web server to be able to access the database. Without a web server, you won't be able to access the database from the Workbench.

Does MySQL need Internet connection? ›

An internet connection is required to download a manifest containing metadata for the latest MySQL products.

What is the name of database in MySQL Workbench? ›

NOTE: Databases are called schema's in MySQL Workbench. MySQL workbench may require a login to your MySQL server. Enter your root or user and password that has been assigned dba server privileges. Click on the New Schema icon in the menu, and then enter a name for your new database in the field as shown.

What file type is MySQL Workbench? ›

mwb(MySQL Workbench file) and . sql(Structured Query Language file).

Can I run SQL query in MySQL Workbench? ›

To run SQL script in MySQL, use the MySQL workbench. First, you need to open MySQL workbench. Now, File -> Open SQL Script to open the SQL script. Note − Press OK button twice to connect with MySQL.

How long does it take to learn SQL? ›

If you're interested in it, one of the first questions you may have is—how long does it take to learn SQL? Luckily, most can learn SQL in three to four weeks. It may vary depending on your experience, how you will use SQL and other factors.

How many data types are there in MySQL? ›

In MySQL there are three main data types: string, numeric, and date and time.

Can I use MySQL without installing? ›

Simplified Steps
  • Download MySQL Community Server 5.7.17 Windows (x86, 64-bit), ZIP Archive.
  • Extract the downloaded MySQL Server Archive to the desired location for MySQL server files (example : D:\mysql\mysql-5.7.17-winx64 )
  • Create a directory for MySQL's database's data files (example : D:\mysql\mydb )
Feb 4, 2017

Which setup to choose while installing MySQL? ›

Choosing a Setup Type
  • Server only: Only install the MySQL server. ...
  • Client only: Only install the most recent MySQL applications (such as MySQL Shell, MySQL Router, and MySQL Workbench). ...
  • Full: Install all available MySQL products, excluding MySQL connectors.

How to use MySQL Workbench to create a database and table? ›

Create a Table
  1. Expand the database in which you want to create a table.
  2. The first item in the expanded menu should be Tables. ...
  3. Give your table a name.
  4. Double-click the empty white section under the table name to add columns.
  5. Define the column name, data type, and any constraints it may require.
Jan 29, 2020

How to use MySQL Workbench to view tables? ›

To use the SHOW TABLES command, you need to log on to the MySQL server first.
  1. On opening the MySQL Command Line Client, enter your password.
  2. Select the specific database.
  3. Run the SHOW TABLES command to see all the tables in the database that has been selected.

How to create table in MySQL for beginners? ›

MySQL CREATE TABLE Statement
  1. CREATE TABLE table_name ( column1 datatype, column2 datatype, ...
  2. ExampleGet your own SQL Server. CREATE TABLE Persons ( PersonID int, ...
  3. CREATE TABLE new_table_name AS. SELECT column1, column2,... FROM existing_table_name. ...
  4. Example. CREATE TABLE TestTable AS. SELECT customername, contactname.

How to write query in MySQL? ›

MySQL - Select Query
  1. You can use one or more tables separated by comma to include various conditions using a WHERE clause, but the WHERE clause is an optional part of the SELECT command.
  2. You can fetch one or more fields in a single SELECT command.
  3. You can specify star (*) in place of fields.

How to add new column in MySQL? ›

How can we add a column in MySQL table?
  1. First, we need to specify the table name.
  2. Next, after the ADD COLUMN clause, we have to specify the name of a new column along with its definition.
  3. Finally, we need to specify the FIRST or AFTER keyword. The FIRST Keyword is used to add the column as the first column of the table.

What is the primary key in SQL? ›

The PRIMARY KEY constraint uniquely identifies each record in a table. Primary keys must contain UNIQUE values, and cannot contain NULL values. A table can have only ONE primary key; and in the table, this primary key can consist of single or multiple columns (fields).

How do I see all databases in MySQL Workbench? ›

Open the Command Prompt and navigate to the bin folder of your MySQL Server installation directory. Then connect to the server using the mysql -u root -p command. Enter the password and execute the SHOW DATABASES; command we have discussed above.

How to read SQL file in MySQL Workbench? ›

Use the file navigator window to find your SQL file, and click on its name to select the file. Click Open on the bottom-right. This button is in the lower-right corner of the file navigator pop-up. It will open your SQL file's contents in the MySQL Workbench app.

What is the difference between view and table in MySQL? ›

A table consists of rows and columns to store and organized data in a structured format, while the view is a result set of SQL statements. A table is structured with columns and rows, while a view is a virtual table extracted from a database.

How to create database command in MySQL? ›

Creating a Database in cPanel Using the MySQL Database Wizard
  1. Log into your cPanel.
  2. Click the MySQL Database Wizard under the Databases heading.
  3. Next to New Database enter a name for your database and click Next Step. ...
  4. Enter a username, enter a password twice, then click the Create User button.
Nov 8, 2022

How to create a database in MySQL with username and password? ›

Create MySQL Database and User
  1. Execute $ SELECT User FROM mysql. user; to list the users.
  2. If user does not exist, create the new user by executing $ CREATE USER '<CNCC User Name>'@'%' IDENTIFIED BY '<CNCC Password>';

Videos

1. MySQL Workbench Tutorial (2022)
(Database Star)
2. SQL Tutorial 2: Installing MySQL, Working with SQL Workbench & Command Line Clients
(SDET- QA Automation Techie)
3. MySQL Workbench 8.0.25 (2021) Tutorial
(BoostMyTool)
4. MySQL and MySQL Workbench Tutorial
(PedroTech)
5. MySQL Workbench Tutorial - How to download and Install WorkBench for MySQL on Windows Machine
(TechBrothersIT)
6. MySQL Tutorial for Beginners [Full Course]
(Programming with Mosh)

References

Top Articles
Latest Posts
Article information

Author: Terrell Hackett

Last Updated: 09/19/2023

Views: 6045

Rating: 4.1 / 5 (72 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Terrell Hackett

Birthday: 1992-03-17

Address: Suite 453 459 Gibson Squares, East Adriane, AK 71925-5692

Phone: +21811810803470

Job: Chief Representative

Hobby: Board games, Rock climbing, Ghost hunting, Origami, Kabaddi, Mushroom hunting, Gaming

Introduction: My name is Terrell Hackett, I am a gleaming, brainy, courageous, helpful, healthy, cooperative, graceful person who loves writing and wants to share my knowledge and understanding with you.