Table of Contents#
- Prerequisites
- Installation Methods
- Verify Installation
- Launch MySQL Workbench
- Connect to a MySQL Server (Quick Setup)
- Uninstall MySQL Workbench (Optional)
- Troubleshooting Common Issues
- Conclusion
- References
Prerequisites#
Before installing, ensure:
- You have a running Ubuntu system (tested on 20.04, 22.04, or newer).
sudoprivileges (to install software).- An active internet connection (to download packages).
Installation Methods#
Method 1: Install from the Official MySQL Repository (Recommended for Latest Version)#
This method uses MySQL’s official APT repository to get the latest stable version of Workbench.
Step 1: Add the MySQL APT Repository#
-
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.debTip: Find the latest package here.
-
Install the downloaded package:
sudo dpkg -i mysql-apt-config_0.8.25-1_all.debDuring 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 updateStep 3: Install MySQL Workbench#
Install the community edition (includes all features):
sudo apt install mysql-workbench-communityMethod 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).
-
Update package lists:
sudo apt update -
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).
-
Install
snapd(if not already installed):sudo apt install snapd -
Install MySQL Workbench via Snap:
sudo snap install mysql-workbench-community
Verify Installation#
To confirm success, check the version:
mysql-workbench --versionOutput example (version may vary):
MySQL Workbench 8.0.32
Launch MySQL Workbench#
From the GUI:#
- Open Ubuntu’s Applications Menu (top-left or bottom-left, depending on your desktop).
- Search for “MySQL Workbench” and click to launch.
From the Terminal:#
Run:
mysql-workbenchConnect 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:
-
Click the
+(plus) icon next to “MySQL Connections”. -
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).
-
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 2If Installed via Snap:#
sudo snap remove mysql-workbench-communityTroubleshooting Common Issues#
1. “Dependency Errors” During APT Installation#
If apt complains about missing dependencies, run:
sudo apt --fix-broken installThen 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:
Then re-add the repo (Method 1) and try again.sudo rm /etc/apt/sources.list.d/mysql.list sudo apt update
3. Snap Installation Fails#
Check snapd status:
sudo systemctl status snapdIf snapd is not running, start it:
sudo systemctl start snapdConclusion#
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! 🚀