The short version of the installation is simple: update your package index, install the mysql-server package, and then run the included security script.
This guide will walk you through the steps to install MySQL version 5.7 on a Ubuntu 16.04 server.
One Ubuntu 16.04 server set up by following this initial server setup guide, including a sudo non-root user and a firewall.
To install it, simply update the package index on your server and install the default package with apt-get.
You'll be prompted to create a root password during the installation. Choose a secure one and make sure you remember it, because you'll need it later. Next, we'll finish configuring MySQL.
For fresh installations, you'll want to run the included security script. This changes some of the less secure default options for things like remote root logins and sample users. On older versions of MySQL, you needed to initialize the data directory manually as well, but this is done automatically now.
This will prompt you for the root password you created in above step. You can press Y and then ENTER to accept the defaults for all the subsequent questions, with the exception of the one that asks if you'd like to change the root password. You just set it in above step, so you don't have to change it now. For a more detailed walkthrough of these options, you can see this step of the LAMP installation tutorial.
Finally, let's test the MySQL installation.
If MySQL isn't running, you can start it with sudo systemctl mysql start.
You have completed a basic MySQL setup installed on your Ubuntu server.