How to Install MySQL Workbench on Ubuntu

MySQL Workbench is a powerful visual tool for database management, development, and administration. It provides a graphical interface for working with MySQL databases, allowing users to easily design, create, and maintain databases.

In this article, we’ll guide you through the process of installing and using MySQL Workbench on Ubuntu.

Installing MySQL Server on Ubuntu

First, start by updating the system’s package repositories to ensure you have the latest software versions available.

sudo apt update

Next, we’ll install the MySQL server, which is one of the most popular open-source relational database management systems (RDBMS) used worldwide.

sudo apt install mysql-server

After the installation is complete, it’s a good idea to run the mysql_secure_installation script to further secure your MySQL server.

This script will guide you through several security-related tasks, such as setting the root password, removing anonymous user accounts, disabling remote root login, and removing the test database.

sudo mysql_secure_installation

Follow the prompts and answer the questions as needed. For example, you may be asked to set the root password, remove anonymous users, disallow remote root login, and remove the test database.

Installing MySQL Workbench on Ubuntu

Now that the MySQL server is installed and configured, we can proceed with installing MySQL Workbench by downloading official DEB package from the MySQL website.

Alternatively, you can use the following wget command to download the latest version. At the time of writing, the latest version is 8.0.38, make sure to replace the version number with the latest one available if it has been updated.

wget https://cdn.mysql.com//Downloads/MySQLGUITools/mysql-workbench-community_8.0.38-1ubuntu24.04_amd64.deb

Once the download is complete, navigate to the directory where the file is downloaded and use the dpkg command to install it.

sudo dpkg -i mysql-workbench-community_8.0.38-1ubuntu24.04_amd64.deb

If the installation fails due to missing dependencies, you can use the following command to install the missing dependencies and complete the MySQL Workbench installation.

sudo apt -f install

Alternatively, you can also install MySQL Workbench using the Ubuntu package repositories. However, the version available in the repositories may be older than the one available on the MySQL website.

To install from the repositories, you can use the following command:

sudo apt install mysql-workbench-community

Launch MySQL Workbench in Ubuntu

After the installation is complete, you can launch MySQL Workbench using the following command.

mysql-workbench

When you launch MySQL Workbench for the first time, it may prompt you to configure a connection to the MySQL server. If so, follow the on-screen instructions to set up a new connection.

Click on the "+" icon in the “MySQL Connections” section of the home screen, fill in the connection details, such as the hostname (or IP address), username, and password and test the connection to ensure it’s working correctly.

Create New Database Connection
Create New Database Connection

Uninstalling MySQL and MySQL Workbench

If you need to remove MySQL and MySQL Workbench from your Ubuntu system, follow these commands.

sudo systemctl stop mysql
sudo apt remove mysql-workbench-community
sudo apt remove mysql-server
sudo apt autoremove

This will completely remove MySQL and MySQL Workbench from your Ubuntu system.

Conclusion

In this article, we’ve covered the step-by-step process of installing MySQL and MySQL Workbench on an Ubuntu system using the official DEB packages provided by MySQL.

We’ve also discussed how to configure and use MySQL Workbench to manage your MySQL databases, as well as how to uninstall both MySQL and MySQL Workbench if needed.

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

Ravi Saive
I am an experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.