How To Install And Use MySQL Workbench On Ubuntu 18.04 or 20.04

Introduction

MySQL Workbench is a unified visual tool for database management. Its graphical interface provides database architects and administrators with an easier way to model data, build and run SQL queries, and maintain a database.

In this tutorial, you will learn how to install, configure, and get started with MySQL Workbench on Ubuntu (18.04 or 20.04).

How to Install and get started with Workbech on Ubuntu.How to Install and get started with Workbech on Ubuntu.

Prerequisites

  • An Ubuntu 18.04 or 20.04 Linux system
  • Access to a command-line/terminal window (Ctrl+Alt+T)
  • A user account with sudo privileges
  • A MySQL server (as Workbench is designed to work with MySQL databases)

Installing MySQL Workbench on Ubuntu

MySQL Workbench is very easy to install and available in the local repository or through deb packages.

Decide which options is best for you and follow the steps in outlined below.

Installing MySQL Workbench Using the Apt Repository

The simplest way to install MySQL Workbench is to use the local apt repository. The only thing you need to do is download the package.

As a rule, always update and upgrade the system, before any installation:

sudo apt update && sudo apt upgrade

Now you can download and install Workbench with the command:

sudo apt install mysql-workbench

Installing MySQL Workbench Using Deb Packages

To install MySQL Workbench from the official apt repository, use the deb package from MySQL archives.

1. Start by navigating to MySQL APT Repository download page and click Download to save the deb package on your Ubuntu system.

Download MySQL APT repository deb package for Ubuntu.Download MySQL APT repository deb package for Ubuntu.

2. Before the download starts, MySQL suggests to login or sign up for an Oracle Web account. To skip signing in for a free account, click No thanks, just start my download.

Skip signing up for a Oracle web account and start MySQL apt download.Skip signing up for a Oracle web account and start MySQL apt download.

3. When the dialogue box appears, select the Save file option and click Ok.

Save the mysql-apt-config deb file on your Ubuntu system.Save the mysql-apt-config deb file on your Ubuntu system.

4. Wait for the download to complete. Then, open a terminal window (Ctrl + Alt + t) to add the MySQL apt repository.

5. In most cases, the saved file will be located in the Downloads folder. To verify its location, navigate to Downloads and list the content of the directory:

cd Downloads
ls

Navigate to Downloads folder and check contents.Navigate to Downloads folder and check contents.

6. Next, add the official MySQL repository to the apt source list by running the command:

sudo apt install ./mysql-apt-config_0.8.22-1_all.deb

Note: The name of the deb file may differ if you downloaded a different version of mysql-apt-config. Change the version number in the command above, if needed.

7. A pop-up window appears asking which MySQL product to install. As the required product is preselected, scroll down to Ok and hit Enter to continue installing.

Select which MySQL product to configure.Select which MySQL product to configure.

8. Wait for the installation to complete.

Complete installing apt package for MySQL Workbench.Complete installing apt package for MySQL Workbench.

10. Then, update the apt cache to add the new repository source:

sudo apt update

11. Finally, install MySQL Workbench by running:

sudo apt install mysql-workbench-community

12. Press y when asked to confirm the installation and wait for the process to complete.

Launch MySQL Workbench

Once you have installed the software, launch the database management tool:

mysql-workbench

The command prompts Workbench to launch and a new window will appear.

mysql workbench home screen showing mysql connectionsmysql workbench home screen showing mysql connections

If you prefer using the GUI, launch Workbench by searching for it in the Activities menu and clicking on the icon as seen below.

locate-mysql-workbenchlocate-mysql-workbench

Configure MySQL Workbench

Before you start managing databases, you may want to modify the default settings. To do so, open the Edit drop-down menu and select Preferences.

edit preferences in mysql workbenchedit preferences in mysql workbench

The Workbench Preferences window appears, consisting of several sections:

  • General Editors
  • SQL Editor
  • Administration
  • Modeling
  • Fonts & Colors
  • Others

Click through the tiles, inspect all the options, and adjust them to fit your needs.

Uninstall MySQL Workbench

To remove or uninstall MySQL Workbench on an Ubuntu system, use the command:

sudo apt remove mysql-workbench

Conclusion

With the help of this article, you should now know how to install MySQL Workbench on Ubuntu from the apt repository or the official deb package. You also learned how to configure and uninstall the software.

The next thing to learn is how to create a database with MySQL Workbench.