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.

Two small things before you go

If something didn’t work on your setup, leave a comment and tell me which distro and version you’re on. I read every one, and most of these articles got better because a reader pointed out what was missing.

And if it did work, share it. TecMint has stayed free for 14 years because people pass these articles around, and that traffic is what pays for writing the next one.

Leave a comment
Get two free Linux courses

Learn the Linux basics with two free courses and join 34,000+ readers getting practical TecMint tutorials and selected Pro TecMint articles every week.

Pro TecMint
Get lifetime access for $99

If you want to go beyond the free tutorials, Pro gives you 18 courses, 5 ebooks, and every future course I add. One payment, lifetime access, no renewals.

Ravi Saive
Ravi Saive
Administrator
About the author

I'm Ravi Saive, an award-winning entrepreneur and founder of several successful 5-figure online businesses, including TecMint.com, GeeksMint.com, UbuntuMint.com, and the premium learning hub Pro.Tecmint.com.

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.