Ubuntu

Install MySQL Workbench on Ubuntu 22.04


MySQL Workbench is a Graphical User Interface (GUI) application supported by Oracle Corporation for MySQL database management. This application also comprises a collection of other tools that can be utilized while working with MySQL databases. MySQL Workbench is primarily utilized by the database administrators, architects, and developers for visualizing the database design.

This write-up will discuss the method to install MySQL Workbench on Ubuntu 22.04. So, let’s start!

Note: As we mentioned earlier, MySQL Workbench is a graphical application for “MySQL” server. To use this utility, a MySQL server must be working on your system. If you do not have access to the database server, follow the below-given procedure to set up the MySQL server on Ubuntu 22.04; otherwise, skip to the next section.

How to set up MySQL server on Ubuntu 22.04

To set up My SQL server on Ubuntu 22.04, you must follow the below-given step-by-step instructions.

Step 1: Update system repositories

Press “CTRL+ALT+T” to open the terminal of the Ubuntu 22.04 and run the below-given command to update system repositories:

$ sudo apt update

Step 2: Install MySQL server on Ubuntu 22.04

In the next step, install the MySQL server on your system with the help of the following command:

$ sudo apt-get install mysql-server

Wait for a few minutes as the installation of the MySQL server will take some time to complete:

Step 3: Verify MySQL service status

Then, check the status of the “mysql” service:

$ systemctl is-active mysql

The given output signifies that “mysql” service is currently active and running on our Ubuntu 22.04 system:

Step 4: Configure MySQL server

Now, write out the below-given command for performing an initial and interactive configuration of the MySQL server:

$ sudo mysql_secure_installation

In the configuration manual, you will be first asked to set the level for the password validation policy. Input a number from the given menu according to your requirements:

After doing so, type out the new password for “root” and enter “y” to continue with the provided password:

Also, set the other configuration options accordingly:

Step 5: Log in to the MySQL server

Next, log in to the MySQL server for setting the default authentication method to “mysql_native_password” and specify a native password for the root:

$ sudo mysql

As you can see, the following query will set the root password to “Password123#@!” and the authentication method to “mysql_native_password”:

> ALTER USER 'root'@'localhost'

IDENTIFIED WITH mysql_native_password BY 'Password123#@!';

Lastly, reload the grant tables in the MySQL database so that the changes can be applied without restarting the “mysql” service:

> FLUSH PRIVILEGES;

Again try to log in to the MySQL server with the password you have set previously:

The above-given error-free output signifies that we have configured the MySQL server on our Ubuntu 22.04 system and we can proceed towards the installation of MySQL Workbench.

How to Install MySQL Workbench on Ubuntu 22.04

Till this point, we have fulfilled all of the prerequisites, and now our Ubuntu 22.04 system is all ready for the installation of “MySQL Workbench”. To do so, execute the following command in the terminal:

$ sudo snap install mysql-workbench-community

After doing so, move to the “Applications” menu and search for the MySQL workbench application and open it:

Congratulations! You have successfully installed MySQL Workbench on Ubuntu 22.04 system:

That was all about setting up MySQL Workbench on Ubuntu 22.04.

Conclusion

To install MySQL Workbench on Ubuntu 22.04, firstly, you need to install and configure the MySQL server. After that, execute the “$ sudo snap install mysql-workbench-communitysnap command for MySQL Workbench installation via snap. This write-up discussed the method to set up a MySQL server and install MySQL Workbench on Ubuntu 22.04. Give it a try and manage the server database using the MySQL Workbench GUI application.

About the author

Sharqa Hameed

I am a Linux enthusiast, I love to read Every Linux blog on the internet. I hold masters degree in computer science and am passionate about learning and teaching.