Reader small image

You're reading from  Learn SQL Database Programming

Product typeBook
Published inMay 2020
Reading LevelIntermediate
PublisherPackt
ISBN-139781838984762
Edition1st Edition
Languages
Right arrow
Author (1)
Josephine Bush
Josephine Bush
author image
Josephine Bush

Josephine Bush has over 10 years experience as a Database Administrator. Her experience is extensive and broad-based, including in financial, business, and energy data systems using MySQL, SQL Server, Oracle, and PostgreSQL. She is a Microsoft Certified Solutions Expert: Data Management and Analytics. She holds a BS in Information Technology, an MBA in IT Management, and an MS in Data Analytics.
Read more about Josephine Bush

Right arrow

Installing and Using MySQL Workbench

In this chapter, we will discuss how to install MySQL Workbench on Windows and Mac, including step-by-step instructions to help you walk through each part of the installation process. The instructions will also show you how to configure MySQL Workbench on both Windows and Mac. We will walk through some examples of connecting to your local MySQL server and also setting up connections to other MySQL servers. We'll conclude with a step-by-step explanation of how to restore a database to MySQL.

In this chapter, we will cover the following topics:

  • Installing MySQL Workbench
  • Using MySQL Workbench
  • Restoring a database

Technical requirements

Installing MySQL Workbench

MySQL Workbench can be installed on various operating systems. In this section, we will cover the installation steps for the Windows and Mac operating systems.

Installing on Windows

The installer process involves several steps, some of which are repeating and non-repeating. The following diagram shows the steps that are repeating and non-repeating during the MySQL installation process:

Installing MySQL on Windows

Using MySQL Workbench

This section will show you how to use MySQL Workbench on both Windows and Mac. These steps include connecting to your local instance and creating a connection to a different MySQL server than the one installed on your local computer.

Let's begin by launching MySQL Workbench.

To launch MySQL Workbench on Windows, do the following:

  1. Select Start and begin typing MySQLWorkbench.
  2. Click on MySQL Workbench to open it.

To launch MySQL Workbench on Mac, do the following:

  1. Navigate to the Applications folder.
  2. Double-click on MySQL Workbench.
  3. If prompted, click Open on the "MySQLWorkbench" is an app downloaded from the Internet. Are you sure you want to open it? popup:

Next, we will cover connecting to your local instance.

Connecting to your local...

Restoring a database

In this section, we will walk through how to restore a database to a MySQL Server instance. Restoring is the process of taking a backup (or copy) of a database and turning it back into a database on the same database server with a different database name or on a separate database server with the same database name as the original database. You can also restore over a database on a server in other words, replacing the current database with a backup of the database but be cautious with this because you will lose data if the database has changed since the last backup. When you back up a MySQL database, the backup process creates SQL files of the entire structure and data of the database. When you restore a database backup, MySQL runs these scripts to recreate the database so that you have an exact copy of the database you backed up. Restoring...

Summary

In this chapter, we covered installing MySQL Workbench on Windows and Mac. This included step-by-step instructions to help you walk through each part of the installation process. The guidelines also included how to configure MySQL Workbench on both Windows and Mac. We walked through some examples of connecting to your local MySQL and also setting up connections to other MySQL servers. We concluded with a step-by-step explanation of how to restore a database to MySQL.

In the next chapter, we will cover what data types are and how to use them. We will learn about specific data types and what data can be stored in each. Data types include string, numeric, and date and time, as well as other types such as JSON. String data types include char and varchar, binary and varbinary, blob, enum, and text. Numeric data types include bit, int, float, double, and decimal. Date and time...

Questions

  1. What operating systems can you install MySQL Workbench on?
  2. How do you check the status of the MySQL service on Mac?
  3. How do you connect to your or another instance of MySQL in MySQL Workbench?
  4. How do you restore a database in MySQL Workbench?
  5. How can you view the duration/fetch time for a query?
  6. How can you view the column names and types for a table in MySQL Workbench?
  7. How do you hide the secondary sidebar in MySQL Workbench?
  8. Where can you find a history of the queries you've executed in MySQL Workbench?
  9. How can you see how many rows a query returned in MySQL Workbench?
  10. How do you select 1,000 rows from a table in MySQL Workbench?
lock icon
The rest of the chapter is locked
You have been reading a chapter from
Learn SQL Database Programming
Published in: May 2020Publisher: PacktISBN-13: 9781838984762
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Josephine Bush

Josephine Bush has over 10 years experience as a Database Administrator. Her experience is extensive and broad-based, including in financial, business, and energy data systems using MySQL, SQL Server, Oracle, and PostgreSQL. She is a Microsoft Certified Solutions Expert: Data Management and Analytics. She holds a BS in Information Technology, an MBA in IT Management, and an MS in Data Analytics.
Read more about Josephine Bush