Step 1: Open terminal using Ctrl+Alt+T. Now copy and paste the following command in the terminal to install MySQL in Linux.
sudo apt install mysql-server
Then give your password and hit ENTER.
Step 2: Press “y” to continue.
It will take some time to download and install MySQL in Linux.
Step 3: To verify the MySQL installation or to know the version enter the following commands in your Terminal.
mysql --version
Step 4: Now we will set the VALIDATE PASSWORD component.
sudo mysql_secure_installation
Step 5: Then press “y” to set the password. Next press “0” for the low-level password or choose as you want to set the password.
Now the whole setup is done. Hence, MySQL installaion is successfully done!