How to Install and Use MySQL Workbench on Ubuntu 18.04

Posted 

3 min read

MySQL Workbench is a cross-platform graphical application for MySQL database administrators and architects. It includes tools for managing databases and users, creating and running SQL queries, configuring servers, taking backups, performing migrations and much more.

In this tutorial, we will show you how to install and use MySQL Workbench on Ubuntu 18.04. The same instructions apply for Ubuntu 16.04 and any Ubuntu-based distribution, including Linux Mint, Kubuntu and Elementary OS.

Prerequisites

Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges.

Installing MySQL Workbench on Ubuntu

Installing MySQL Workbench on Ubuntu is a pretty straightforward process. Update the packages index and install the MySQL Workbench package:

sudo apt update
sudo apt install mysql-workbench
The MySQL Workbench package which is available in the Ubuntu default repositories may not always be the latest version.

Launching MySQL Workbench

Now that MySQL Workbench is installed on your Ubuntu system you can start it either from the command line by typing mysql-workbench or by clicking on the MySQL Workbench icon (Activities -> MySQL Workbench).

When you start MySQL Workbench for the first time, a window like the following should appear:

Using MySQL Workbench

One of the most useful features of MySQL Workbench is that it allows you to easily configure SSH tunneling to local and remote servers. This way you do not need to expose the MySQL server to the outside world, you only need a SSH access to the remote server.

To add a new connection click on the circled plus sign ⊕ next to “MySQL Connections”.

A new window “Setup New Connection form” will open. In this example, we’ll connect to a remote server over SSH. Enter a meaningful name in the “Connection name” field and select Standard TCP/IP over SSH from the “Connection Method” Dropdown.

  • In the “SSH hostname”, enter the server’s hostname or IP Address followed by the SSH port.
  • Enter your remote “SSH Username”. For authentication, you can use either the user password or an SSH key.
  • Leave the default value of the “MySQL Hostname” field(127.0.0.1).
  • Enter your remote database login credentials in the “Username” and “Password” fields.

Once done, click on the “Test Connection” button.

If this is the first time you are connecting to the server through SSH you will see a message like “SSH Server Fingerprint Missing”, click “Continue”.

If the test is successful you’ll see something like this:

The new connection will be shown on the MySQL Workbench start page. Double-click on it to connect.

Once connected, you should something like below including a list of all the databases in the Schema section:

Conclusion

You have learned how to install MySQL Workbench on your Ubuntu 18.04 desktop. You can now start managing your MySQL users and databases. To find more information about how to use MySQL Workbench visit the official MySQL Workbench page.

If you have any question, please leave a comment below.