How to Use MySQL Workbench: Beginner Tutorial Guide

205.4K views
•
August 30, 2023
by
Amit Thinks
YouTube video player
How to Use MySQL Workbench: Beginner Tutorial Guide

TL;DR

MySQL Workbench is a graphical UI for working with MySQL servers and databases, letting you right-click to create schemas and tables instead of typing commands. Install it from mysql.com by downloading the MySQL Installer for Windows and selecting server, shell, and workbench as custom products. After adding the server bin folder to the system PATH, you can connect with the root password and manage everything visually.

Transcript

Welcome to Amit thinks YouTube channel. In   this video course learn MySQL  workbench and its concepts. The workbench is a UI that is a graphical tool  for working with MySQL servers and databases. MySQL is an open-source relational database  management system that is RDBMS. It is one of the most popular RDBMS wherein records are stored  in the for... Read More

Key Insights

  • MySQL Workbench is a graphical user interface for working with MySQL servers and databases, which means database and table creation happens through right-click menus and forms rather than through typed commands, making administration easier for a database administrator.
  • MySQL is a relational database management system based on SQL, where records live in tables composed of rows and columns. You create a database first, then create multiple tables under it, and each table holds your saved data.
  • MySQL is open source and free to download, supports large databases, is compatible with PHP so you can connect it to a website and host the site database on MySQL, and is described in the video as secure and highly flexible.
  • The installation path runs through mysql.com to Downloads, then MySQL Community Downloads, then MySQL Installer for Windows. The installer page notes a 32-bit build, but the video states it works for 64-bit systems as well.
  • Choosing the custom setup type during installation lets you pick exactly which products get installed. The video selects MySQL Server, Workbench, and Shell by dragging each one from the available products list into the selected column.
  • The recommended strong password authentication method is kept during product configuration, along with the default network port, the Windows service settings, and full-access server file permissions, before clicking execute to apply every configuration step.
  • Adding the MySQL server bin folder to the system environment variables Path lets you run MySQL from the command prompt. You then log in with the root user and password, list databases with SHOW DATABASES, and add one with CREATE DATABASE.
  • In Workbench, schemas shown on the left panel are the databases. Double-clicking a table automatically executes a SELECT star query so the data appears immediately, and separate tabs expose the table's indexes, foreign keys, and triggers.

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: What is MySQL Workbench and what is it used for?

MySQL Workbench is a UI, a graphical tool for working with MySQL servers and databases. It removes the need to write multiple commands for routine work: you right-click to create a database, right-click to create a table, and use menu options to import data from a CSV, JSON, or SQL file. Results of queries appear in a results panel that confirms the action succeeded and reports how many rows were returned, and you can also export data from the same interface. Overall it makes the work of a database administrator easier.

Q: What is MySQL and how does it store data?

MySQL is a relational database management system, an RDBMS, which is based on SQL. Because it is SQL based, you store data in the form of tables: you create a database, then create multiple tables under that database, and every table has rows and columns where your records are saved. MySQL is open source, was initially released in 1995, and was written in C and C++. It is now supported by Oracle and is used by top companies including Facebook and YouTube, making it one of the most popular relational database systems available.

Q: Why use MySQL Workbench instead of the MySQL command line?

Both a MySQL command line and MySQL Workbench are available, but Workbench is preferred because it is a UI. With the command line you have to type out multiple commands to accomplish your work, while in Workbench you simply right-click and choose create database, or right-click and choose create table. Importing from CSV, JSON, or SQL files is a menu action, exporting is a menu action, and results are displayed visually so you can immediately confirm a query ran correctly. The graphical approach makes the whole workflow faster for database administration.

Q: What are the main features of MySQL?

MySQL is based on SQL, so data is organized into databases, tables, rows, and columns. It is open source, which means you can freely download it. It easily supports large databases. It is compatible with PHP, so you can connect it with PHP, work around your website, and host your website database under MySQL. The video also describes MySQL as secure and highly flexible. These features together are why it is presented as one of the most popular relational database management systems in use.

Q: How to install MySQL Workbench on Windows?

Open a web browser, search for MySQL, and open the official site mysql.com. Go to Downloads, scroll down to MySQL Community Downloads, and click MySQL Installer for Windows. The current version is preselected automatically. Two download options appear, and the larger non-web installer is the one chosen in the video. Skip the sign-up by clicking the no thanks link to start the download. When the MSI file finishes downloading, double-click it to begin installation, choose the custom setup type so you can see exactly what is being installed, and continue through the product selection.

Q: Which products should you select in the MySQL installer?

After choosing the custom setup type, you select the products to install. Open the MySQL Server dropdown, expand the MySQL 8.0 entry, and click the arrow to drag the server into the selected products list. Then go to Applications and do the same for MySQL Workbench, and repeat the step for MySQL Shell. With the server, Workbench, and Shell all listed as selected products, click next and the installation begins. Once installation completes, product configuration runs so you can set the network, authentication method, root password, service, and file permissions.

Q: How to set the MySQL PATH environment variable on Windows?

Open the C drive, go to Program Files, scroll down to the MySQL folder, open it, open the server folder, open the bin folder, and copy that path. Then open the Start menu and type environment variables, making sure to choose system environment variables, and click open. Click the environment variables button, and under system variables scroll down to Path and double-click it. Click new, then right-click and paste the copied bin path, and click OK. After this, opening a command prompt and running the MySQL version command confirms the installation works.

Q: How to create a new database and table in MySQL Workbench?

Open Workbench and connect using the default root user created during installation by double-clicking the connection and entering the password. On the left, hover over the schemas area and click the create new schema icon, or right-click and choose create schema. Enter the database name and keep the default character set and collation, then click apply. A review window shows the SQL command that will run, so click apply again and then finish. The new database appears on the left. Right-click its tables entry and choose create table, name the table, then double-click in the columns grid to add each column.

Summary & Key Takeaways

  • MySQL is an open-source relational database management system based on SQL, now supported by Oracle and used by top companies such as Facebook and YouTube. Data is stored in tables made of rows and columns: you create a database, then create multiple tables under it. MySQL was written in C and C++.

  • MySQL Workbench is preferred over the MySQL command line because it is a graphical tool. Instead of writing multiple commands, you right-click to create a database or a table, import from CSV, JSON, or SQL files, and export results. The results panel confirms whether a query ran successfully and how many rows returned.

  • Installation goes through mysql.com, Downloads, MySQL Community Downloads, then MySQL Installer for Windows. The larger non-web installer is chosen, custom setup type is selected, and MySQL Server, Workbench, and Shell are dragged into the products list. Configuration covers the network port, authentication method, root password, Windows service, and file permissions.

  • After installation the server bin path under Program Files is copied and added to the system environment variables under Path, so MySQL runs from the command prompt. Checking the version and logging in with user root and the password confirms the install, and SHOW DATABASES lists the defaults before CREATE DATABASE adds a new one.

  • Inside Workbench, schemas on the left are the databases. Clicking a table reveals its columns, and double-clicking runs a SELECT star query automatically so the table data appears along with tabs for indexes, foreign keys, and triggers. New schemas are created by right-clicking and confirming through a review window that shows the generated SQL.


Read in Other Languages (beta)

Share This Summary 📚

Explore More Summaries from Amit Thinks 📚