MySQL is one of the world’s most popular databases among RDBMS (Relational Database Management System). If you are a developer then MySQL may be one of the must-have software you need. Here we will show you how you can install MySQL server and workbench in Ubuntu or any other Debian based Linux distribution.
1.) Update your system
Your Linux repository list should be updated first.
sudo apt-get update
2.) Install server
By default, the MySQL server is included in the default repository of your Linux distribution so no need to worry about getting new repository.
sudo apt-get install mysql-server
3.) Secure your MySQL Server installation
It is recommended to secure your installation using below command.
4.) Enter the password
You may have been already asked to enter a password in step 1 and if not, you will be asked to enter at this step. The message will appear something like this.
After this, you will be prompted with different options. These options will be – change the password, Remove anonymous user, Disallow root login remotely, Remove test database and access to it, Remove test database, Reload privilege tables etc. You can answer it in “Y” (yes) or any other key for No as per your requirements.
5.) Test the installation
You can check whether the installation is successful and the service is running or not with below command. If everything was correct, you will see MySQL service running with the green light in the left of it.
sudo systemctl status mysql.service
6.) Check the version
You can check the current version of your MySQL installation with below command.
sudo mysqladmin version
7.) Install MySQL Workbench
You can install the latest workbench which will provide you a graphical user interface and much more advanced functions shall you need it, use below command.
sudo apt-get install mysql-workbench
This will install the latest MySQL workbench and you should be able to see it in your distribution’s app search functionality or add a launcher.
If you are stuck at any particular point, please feel free to post in the comment, we shall get back to you faster than you can imagine.