dotlinux blog

How to Install MySQL Workbench on Ubuntu

MySQL Workbench is a visual database design and management tool for MySQL (and MariaDB) databases. It simplifies tasks like:

  • Designing entity-relationship (ER) diagrams.
  • Writing and executing SQL queries.
  • Managing database schemas, users, and permissions.
  • Importing/exporting data.

For Ubuntu users, there are multiple installation methods (official repo, default repos, or Snap). This guide covers each approach to help you choose the best fit for your needs.

2026-03

Table of Contents#

  1. Prerequisites
  2. Installation Methods
  3. Verify Installation
  4. Launch MySQL Workbench
  5. Connect to a MySQL Server (Quick Setup)
  6. Uninstall MySQL Workbench (Optional)
  7. Troubleshooting Common Issues
  8. Conclusion
  9. References

Prerequisites#

Before installing, ensure:

  • You have a running Ubuntu system (tested on 20.04, 22.04, or newer).
  • sudo privileges (to install software).
  • An active internet connection (to download packages).

Installation Methods#

This method uses MySQL’s official APT repository to get the latest stable version of Workbench.

Step 1: Add the MySQL APT Repository#

  1. Download the MySQL APT configuration package (replace the URL with the latest version for your Ubuntu release):

    wget https://dev.mysql.com/get/mysql-apt-config_0.8.25-1_all.deb

    Tip: Find the latest package here.

  2. Install the downloaded package:

    sudo dpkg -i mysql-apt-config_0.8.25-1_all.deb

    During installation, a configuration window may appear. Select your preferred MySQL server version (e.g., “MySQL 8.0”) and click OK (no need to change Workbench settings here).

Step 2: Update Package Index#

Refresh Ubuntu’s package list to include the new MySQL repository:

sudo apt update

Step 3: Install MySQL Workbench#

Install the community edition (includes all features):

sudo apt install mysql-workbench-community

Method 2: Install from Ubuntu’s Default Repositories (Simpler, Older Version)#

Ubuntu’s default repositories include MySQL Workbench, but the version may be outdated. Use this for simplicity (not recommended for the latest features).

  1. Update package lists:

    sudo apt update
  2. Install MySQL Workbench:

    sudo apt install mysql-workbench

Method 3: Install via Snap (Universal Package)#

Snap is a universal package manager (works across Linux distributions).

  1. Install snapd (if not already installed):

    sudo apt install snapd
  2. Install MySQL Workbench via Snap:

    sudo snap install mysql-workbench-community

Verify Installation#

To confirm success, check the version:

mysql-workbench --version

Output example (version may vary):

MySQL Workbench 8.0.32

Launch MySQL Workbench#

From the GUI:#

  1. Open Ubuntu’s Applications Menu (top-left or bottom-left, depending on your desktop).
  2. Search for “MySQL Workbench” and click to launch.

From the Terminal:#

Run:

mysql-workbench

Connect to a MySQL Server (Quick Setup)#

When you first launch Workbench, you’ll see a “Setup New Connection” option. To connect to a local MySQL server:

  1. Click the + (plus) icon next to “MySQL Connections”.

  2. In the dialog:

    • Connection Name: A label (e.g., “Local MySQL”).
    • Hostname: localhost (or your server’s IP).
    • Port: 3306 (default MySQL port).
    • Username: root (or your database user).
    • Password: Enter the password (or use “Store in Vault” for security).
  3. Click Test Connection to verify. If successful, click OK to save the connection.

Uninstall MySQL Workbench (Optional)#

If Installed via APT (Methods 1 or 2):#

sudo apt remove mysql-workbench-community  # For Method 1
# OR
sudo apt remove mysql-workbench            # For Method 2

If Installed via Snap:#

sudo snap remove mysql-workbench-community

Troubleshooting Common Issues#

1. “Dependency Errors” During APT Installation#

If apt complains about missing dependencies, run:

sudo apt --fix-broken install

Then retry the installation.

2. “Repository Not Found” (Method 1)#

If sudo apt update fails, check the MySQL repository configuration:

  • Reinstall the APT config package (from Step 1 of Method 1) and ensure you selected a valid MySQL version.
  • Or remove the MySQL repo:
    sudo rm /etc/apt/sources.list.d/mysql.list
    sudo apt update
    Then re-add the repo (Method 1) and try again.

3. Snap Installation Fails#

Check snapd status:

sudo systemctl status snapd

If snapd is not running, start it:

sudo systemctl start snapd

Conclusion#

Choose your installation method based on your needs:

  • Official Repository (Method 1): Best for the latest features and security updates.
  • Default Repositories (Method 2): Quick and simple, but outdated.
  • Snap (Method 3): Universal (works on any Linux distro with Snap) but may have sandboxing limitations.

With MySQL Workbench installed, you can now design, query, and manage your databases efficiently!

References#

Happy database designing! 🚀