Set up MySQL database on Amazon AWS Cloud
1. Create an account on Amazon AWS.
Complete the sign in for the AWS account. Note that AWS will request a credit card info, but will not charge for any services. AWS provides many free tier products and MySQL RDS is one of the services that can be accessed for free.
2. Click on the Services tab as shown below, or search for RDS in the search box and click on RDS under database.
This will create a free tier MySQL RDS on AWS on which you can learn and access the database.
3. Click on the Databases menu on the left side, and click on Create database. Choose Easy create, MySQL and Free tier.
4. Set up a database identifier that can be used by other applications which need to connect to the database, including allowing you to access it from MySQL Workbench.
Choose the database instance name and master username. Either select Auto generate a password or enter your master password in the Master password and Confirm password fields. Expand View default settings for Easy create and review the settings. Click on Create database.
5. Set up access to the database from your local IP address so you can access the database from MySQL Workbench on your computer.
Amazon creates a default VPC (Virtual Private Network) that will be used to access the MySQL database from within the VPC only. To access the database from your local PC from home or office using MySQL Workbench, add your IP address to the security group. After the database has been created, select the database name from the list of databases and click on the VPC security group listed under Security. Click on Inbound rules and add your local/home IP address. Add a new rule for MySQL/Aurora for both inbound and outbound rules.
6. Write down the credentials of the MySQL database from the database configuration dashboard on AWS RDS console.
From the database identifers, the following are the connection strings to connect to external applications or access your database from MySQL workbench. Endpoint: my-test-db-name.hd822sj0sjs2.us-east-2.rds.amazonaws.com Port: 3306 Username: master username that you entered while creating the database Password: password that you either entered manually or chose to automatically generate View the configuration by clicking on the Configuration tab under the database. Note: In the screenshot above, DB name is empty because we chose the Easy create option. By default, AWS doesn’t provide a db name – by default, it’s set to sys. However, you can create a database (schema) by connecting your database instance in MySQL workbench.
7. Using the database credentials you wrote down, set up and access AWS RDS from MySQL Workbench on your computer.
8. Use the delete option on the AWS RDS console to delete the MySQL database if it's no longer needed after training, so that you don't incur overtime charges from AWS.
AWS RDS Free tier provides up to 20GB of storage and 750 hours of uptime (read/write) for your free tier. To delete the database: Access the RDS from Databases console. Click on Actions > Delete. Enter Delete me and click Delete. If you would like to keep a snapshot of your database, choose the Take snapshot option before deleting. However, note that AWS will charge for the storage of the snapshot.