EC2 MySQL
We are now going to setup a database on an EC2 instance. This concepts apply to most databases, but we're going to use MySQL in this example.
Setup The EC2 Instance
Most of the setting will be the same that we've been using for the other instances, but the security group will be different.
In a lot of cases, we will restrict which IP addresses can access a database instance. We might only let processes on the same instance access the database, or other instances that we setup in a private network on AWS (more about that in the VPC section).
It's generally the most important part of the infrastructure and we need to keep it secure, so we really wan't to avoid opening up the database port to the public.
That being said, sometimes we need to be able to access a database over the public internet, and it's makes this demonstration slightly easier, so we will be allowing connections on port 3306 from anywhere.
Just try to avoid this unless it's absolutely necessary.
Install MySQL
This will install the most recent stable version of the MySQL server and client that exists in the official Ubuntu repositories. As of writing this, the major version is 8.
Follow the prompts like this: