Amazon Lightsail also offers a provision to create database separately from the installed instances with its own dedicated storage space. Yes, it is paid and comes in different plans. The standard price plans available for Amazon Lightsail Databases in one Availability Zone only, with no redundancy, are:
$15- 1GB Memory, 1 vCPU, 40 GB SSD Storage and 100 GB transfer
$30– 2GB Memory, 1 vCPU, 80 GB SSD Storage and 100 GB transfer
$60– 4GB Memory, 2 vCPU, 120 GB SSD Storage and 100 GB transfer
$115– 8GB Memory, 2 vCPU, 240 GB SSD Storage and 200 GB transfer
Here we let you know how to create a Mysql Database on AWS LightSail, however, you can also see- how to install WordPress on AWS Lightsail to know more about it.
Step 1: Go to Amazon Light Home/Dashboard, select Databases
Like the Lightsail instance plan, the starter plan of Amazon Lightsail Database is also free for one month. To check it out you can simply signup to Amazon Lightsail using a credit card; don’t worry they will not charge before one month at all. Here is the link to the Signup page.
So, coming to the point, if you already have some instance or web app and want to have a MySQL database for the same, you can create it on a fast server of Amazon AWS.
At a home page of Amazon Lightsail click on the Databases tab and then on the Create database button.
Step 2: Select the Lightsail Database location
The first thing in the direction of creating an Amazon Lightsail database is to select the data centre location where you want to host your database and its data. Select the nearest one to your vicinity, it helps to reduce the response time and gives you a better service and speed. For example, if your target audience is in the USA, then select the US location for low response time and better performance for your website or app visitors.
Step 3: Pick your database- MySQL or PostgreSQL
On AWS Lightsail, we have offered two kinds of databases by AWS, one is the most popular and widely used i.e MySQL and another one is PostgreSQL. However, the PostgreSQL has a very good reputation and stability but because most of the users use MySQL, thus we select it to install. Nevertheless, the process of installation will be the same for both the databases.
While writing this tutorial, the versions of Amazon Lightsail MySQL database available to install were 5.6, 5.7 and latest one 8.0. In the same way for PostgreSQL- 9.6, 10.9 and 11.4.
Click on Mysql to select it and from the drop-down box the version you want to install.
Step 4: Opt for Lightsail database pricing
These are the standard plans of Lightsail Database, select the one which is feasible for you and move to the next step.
Step 5: Name your Amazon Lightsail database
By Default, the name assigned to Database is Database-1, however, you can efface it and type the one which you can remember or as per the project. For this tutorial, we are using the default one.
And finally, click on the Create Database button.
Step 6: How to access the Lightsail database
Once the Database gets created, click on that to open and access its connection details.
On the next page, you will find Amazon Lightsail Database connection details such as username and password including Endpoint address along with default port.
Step 7: Enable Amazon Lightsail Database external access
By default, we can’t connect our created database, so to connect and access it externally we have to enable it. Just under the Endpoint and port section, click on Public mode is disabled option.
After that enable the Network Security Toggle button for Public access.
Step 7: How to Connect to the Lightsail Database
There are a couple of ways to connect MySQL database, the popular one is via phpMyAdmin, however, if you don’t have installed it then use some Graphical user interface Database Manager tool such as the official one known as MySQL Workbench. To know more about open source MySQL GUI Manager Tools see Best opensource MySQL GUI Tools for Windows and Ubuntu/Linux.
Here we are using MySQL workbench on Windows 10 to access and manage our Amazon Lightsail MySQL Database remotely. It free to download and use. Here is the link to get it.
First, install MySQL workbench on your system and then open the same.
Click on the + icon to add a new connection.
Enter the following Details.
Connection Name: Type Whatever you want to remember the connection to Lightsail Database.
Connection: Select between Standard TCP/IP or
Hostname: Copy and past the Endpoint address available on your Amazon Lightsail Database.
Username: Type username created by Lightsail for your Database
Finally, Click on the OK button.
Enter the Password which has on Lightsail and then clicks on the OK button. You can also check the Save Password in Vault to save your self from entering it every time you want to connect the database.
Finally, you will see it has been connected and now you can use it to create, delete and edit database schemes including running of different SQL queries.