MySQL is free and widely used, it has a big community and great documentation, so if you’re just started out with databases, MySQL might be a good choice.
In this guide, you will learn how to install MySQL on Ubuntu 20.04. The only prerequisite, is you need to have root access or you have sudo privileges, other than that, you’re good to go.
Open up your terminal and type the following:
$ sudo apt update $ sudo apt install mysql-server -y
-y flag will confirm that we’re agreeing for all required dependencies for MySQL, this will take few seconds/minutes depending on your hardware.
You also want to change the less secure default options for MySQL using the command:
$ sudo mysql_secure_installation
You’ll be prompted multiple times for inserting the password strength, the password itself and other stuff. If you’re not sure about them, just press
"Y" for all prompts and you’re good to go.
Now to make sure you installed MySQL properly, you can easily start it using the following command:
$ sudo mysql
Awesome, MySQL will welcome you and you’re ready to start using MySQL
In this tutorial, you managed to install the latest stable version of MySQL on Ubuntu 20.04, congratulations!
Happy Installing ♥