Install and Get Started with MySQL Workbench on Ubuntu

October 10, 2024

Introduction

MySQL Workbench is an integrated GUI tool for MySQL database management. Its graphical interface provides an easier way for database architects and administrators to model data, build and run SQL queries, and manage databases.

This tutorial shows you how to install, configure, and get started with MySQL Workbench on Ubuntu.

Install and Get Started with MySQL Workbench on Ubuntu.

Prerequisites

How to Install MySQL Workbench on Ubuntu

Multiple methods exist for installing MySQL Workbench on Ubuntu. Aside from downloading packages from the official APT repository, the tool can also be installed using Snap packages, DEB files, or compiling from the source.

The following sections contain the instructions for all the installation methods mentioned above.

Installing MySQL Workbench on Ubuntu via APT Package Manager

The simplest way to set up MySQL Workbench is via the official APT repository. Proceed with the following steps to add the repository to the system and install MySQL Workbench:

1. Go to the Downloads section of the official MySQL website and download the DEB package containing repository information.

Downloading the repository setup DEB package.

2. Log in or sign up for an Oracle Web account. Alternatively, skip the step by clicking No thanks, just start my download and wait for the download to finish.

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

3. Open the terminal and use the following command:

sudo dpkg -i [path_to_DEB_file]

Replace [path_to_DEB_file] with the actual path to the downloaded file. For example, to install the mysql-apt-config_0.8.32-1_all.deb package located in the ~/Downloads directory, enter:

sudo dpkg -i ~/Downloads/mysql-apt-config_0.8.32-1_all.deb

4. When prompted, select Ok to save the configuration.

The mysql-apt-config configuration dialog.

5. Using the Tab button and the arrow keys, ensure that the MySQL Server & Cluster item is highlighted, then select the Ok button below to configure the product.

The product selection page of the mysql-apt-config configuration dialog.

6. Highlight the mysql-8.0 version and select Ok.

The server version page of the mysql-apt-config configuration dialog.

7. Press Ok to confirm the configuration.

8. In the product selection menu, highlight Ok in the list, then select the Ok item below to exit the configuration wizard.

The product selection page of the mysql-apt-config configuration dialog after configuring the server.

9. Update the APT package list from the terminal:

sudo apt update

10. Download and install Workbench with the following command:

sudo apt install mysql-workbench-community

11. When prompted, type Y and press Enter to start the installation.

Installing MySQL Workbench Community from the official APT repository.

Install MySQL Workbench on Ubuntu Using DEB Packages

MySQL Workbench is also available as a DEB package, which can be helpful when working on systems not connected to the internet. Follow the steps to download and install the MySQL Workbench DEB package:

1. Visit the General Availability Releases section of the official website.

2. Choose Ubuntu Linux in the Select Operating System dropdown menu.

3. Select the file and wait for the download to complete.

Downloading MySQL Workbench DEB package.

4. Install the DEB package with the dpkg command:

sudo dpkg -i [path_to_DEB_file]

For example, to install mysql-workbench-community_8.0.38-1ubuntu24.04_amd64.deb located in the ~/Downloads directory, type:

sudo dpkg -i ~/Downloads/mysql-workbench-community_8.0.38-1ubuntu24.04_amd64.deb
Installing MySQL Workbench DEB file.

Install MySQL Workbench on Ubuntu Using Snap

MySQL Workbench is also available as a Snap package. Snaps are a modern packaging format designed for the Ubuntu ecosystem.

Type the following command to install the Workbench Snap using the terminal:

snap install mysql-workbench-community

Alternatively, follow the steps below to perform the same operation via Ubuntu GUI:

1. Press the Super/Windows key to open the Activities view.

2. Search for Ubuntu Software, then click the search result to start the application.

Searching for the Ubuntu Software app in Ubuntu.

3. Search for MySQL Workbench in Ubuntu Software and select the tool from the search results.

Searching for MySQL Workbench in Ubuntu Software.

4. Click the Install button.

Installing MySQL Workbench in Ubuntu Software.

5. Type the sudo password for the user. The installation starts.

Install MySQL Workbench on Ubuntu via Source Code

MySQL Workbench Community Edition is an open-source program, which means the source is freely available for downloading and compiling on a system. Follow the steps below to install MySQL Workbench on Ubuntu via source code:

1. Visit the official MySQL Workbench downloads page.

2. Choose Source Code in the Operating System dropdown menu.

3. Select All Operating Systems in Select OS Version.

4. Click the Download button to start downloading the TAR.GZ archive.

Downloading a TAR.GZ file containing the generic, architecture independent source code for MySQL Workbench.

5. Unpack the archive by typing:

tar xf [path_to_tar_gz_archive]

For example, to unpack the mysql-workbench-community-8.0.38-src.tar.gz archive located in the Downloads directory, type:

tar xf ~/Downloads/mysql-workbench-community-8.0.38-src.tar.gz

Note: Alternatively, download the files by cloning the official git repository: git clone https://github.com/mysql/mysql-workbench.git

6. Go to the main project directory:

cd [mysql_workbench_directory]

7. Create and go to the build directory:

mkdir wb-build & cd wb-build

8. Update the package sources list:

sudo apt update

9. Install the necessary dependencies:

sudo apt install build-essential cmake libgtk-3-dev libglib2.0-dev libgladeui-dev libzip-dev libmysqlclient-dev libsqlite3-dev libssl-dev libpcre2-dev libcurl4-gnutls-dev libxml2-dev libgcrypt20-dev python3-dev python3-pip libboost-dev libtool libjpeg-dev libpng-dev libpixman-1-dev swig default-jre libgtkmm-3.0-dev libmysqlcppconn-dev libvsqlitepp-dev libgdal-dev rapidjson-dev unixodbc python3-pyodbc libsecret-1-dev antlr4 libantlr-dev libantlr4-runtime-dev libssh-dev

10. Use the cmake command to define the build configuration and generate project files:

cmake ..

Depending on your configuration, the command may require additional options. For example, the following cmake command defines paths for Antlr4 parser generator files and configures UnixODBC as a driver manager:

cmake -DANTLR_JAR_PATH="/usr/share/java" -DANTLR4_INCLUDE_DIR="/usr/share/java" -DUSE_UNIXODBC=True -DUNIXODBC_INCLUDE_DIRS="/usr/include" ..
The output of the cmake command.

11. Compile the application with the make command:

make
The output of the make command.

12. Finally, install MySQL Workbench:

sudo make install

Launch MySQL Workbench

Once you have installed the software, launch MySQL Workbench. Search for it in the Activities menu and click the icon in the search results.

Searching for MySQL Workbench in the Activities search bar.

Alternatively, launch the following command from the terminal:

mysql-workbench-community

A MySQL Workbench instance opens.

MySQL Workbench GUI.

Configure MySQL Workbench

MySQL Workbench allows users to modify the default settings before starting database management. To access Workbench preferences:

1. Select Edit in the top menu and choose Preferences.

The location of the Preferences dialog in MySQL Workbench.

The Workbench Preferences window appears.

The Workbench preferences window.

2. Make the necessary changes. The Preferences section consists of several sub-sections:

  • General Editors. Contains SQL Parsing and general formatting options.
  • SQL Editor. Features configuration parameters for Query Editor, Object Editors, and SQL Execution.
  • Administration. Hosts data export and import preferences.
  • Modeling. Contains Default valuesMySQL version settings, Diagram formatting, and Appearance options.
  • Fonts. Allows changing various interface fonts.
  • SSH. Provides parameters for SSH connections.
  • Others. Contains miscellaneous options.

Uninstall MySQL Workbench

The procedure to remove MySQL Workbench from an Ubuntu system depends on the installation method:

  • If the application was installed from the official repository, use the following apt command:
sudo apt remove mysql-workbench-community
  • Uninstall the DEB file by entering:
sudo dpkg --purge [deb_package_name]
  • Use the command below to remove the MySQL Workbench Snap package:
sudo snap remove mysql-workbench-community
  • If you installed MySQL Workbench from the source code, remove the created files and directories.

Conclusion

This article showed you how to install, configure, and remove MySQL Workbench on Ubuntu. The installation methods included the official APT repository, DEB package, Snap store, and source code.

Next, learn how to create a database with MySQL Workbench.

Was this article helpful?
YesNo
Marko Aleksic
Marko Aleksić is a Technical Writer at phoenixNAP. His innate curiosity regarding all things IT, combined with over a decade long background in writing, teaching and working in IT-related fields, led him to technical writing, where he has an opportunity to employ his skills and make technology less daunting to everyone.
Next you should read
How To Show a List of All Databases in MySQL
October 13, 2022

With Structured Query Language (SQL), you can easily access and manage content in all your databases. This...
Read more
How to Check the MySQL Version In Linux
July 11, 2019

It is essential to know which version of MySQL you have installed. The version number helps to determine if a...
Read more
How To Set Up MySQL Master Slave Replication
January 16, 2024

In cloud computing, master-slave data replication refers to storing the same information on multiple servers.
Read more
How to Rename a MySQL Database
March 20, 2024

As an administrator, you may need to rename a database. However, for security, the command to rename a...
Read more