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).
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)
Mục lục bài viết
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.
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.
3. When the dialogue box appears, select the Save file option and click Ok.
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
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.
8. Wait for the installation to complete.
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.
If you prefer using the GUI, launch Workbench by searching for it in the Activities menu and clicking on the icon as seen below.
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.
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.