# OvalEdge DB on AWS RDS

This article provides step-by-step instructions to provision an AWS MySQL-compatible RDS instance for the OvalEdge platform. It includes prerequisites, database creation, schema setup, and execution of OvalEdge database scripts to prepare the backend for application deployment.

## Prerequisites

Ensure the following requirements are met before starting the setup:

* **AWS Account Access**: An active AWS account with permissions to create and manage RDS resources.
* **AWS Management Console Access**: Ability to log in and navigate to the RDS service.
* **MySQL Client or GUI Tool Installed**: Tools such as MySQL Workbench, DBeaver, or the MySQL CLI should be available on your local machine or EC2 instance.

## Create MySQL Database in RDS

Follow the steps below to provision a new MySQL-compatible RDS instance:

1. Log in to the **AWS Management Console** and navigate to **RDS**.
2. Click **Create database**.

   <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FKChgWktuPiwERwVNSh4l%2Fimage.png?alt=media&#x26;token=b0b973be-f1f9-4ec4-9cb0-0b7116562b42" alt=""><figcaption></figcaption></figure>
3. Select **Standard Create**.

   <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FrbA73EhH5n9CxEHKa8Ph%2Fimage.png?alt=media&#x26;token=d69a8910-f92f-422d-a460-578b9100f316" alt=""><figcaption></figcaption></figure>
4. Choose **MariaDB** as the engine.

   <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2Fmt3p1h7YgFjJczKlWntD%2Fimage.png?alt=media&#x26;token=e3574255-b51b-4334-810d-db0ed94f7fd7" alt=""><figcaption></figcaption></figure>
5. Under **Version**, select the latest available in the **8.4.x** series.

   <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FRBKMMg7K3NV4pZKGTxQQ%2Fimage.png?alt=media&#x26;token=98b68d47-75c9-4938-85ee-7616aefecee4" alt=""><figcaption></figcaption></figure>
6. Select a **template** based on workload (e.g., *Production* or *Dev/Test*).

   <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FULpyepEa7K8BD8eQJnLo%2Fimage.png?alt=media&#x26;token=b1a0edd9-1c26-411c-94a8-af00398531fb" alt=""><figcaption></figcaption></figure>
7. Enter a **DB instance identifier** (e.g., `ovaledge-db`).

   <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FwYgZbMhvEcGbtNYEqOhj%2Fimage.png?alt=media&#x26;token=522578c5-a035-427f-a4c4-c296b212f2a9" alt=""><figcaption></figcaption></figure>
8. Set the **Master username**, then either:
   * Auto-generate the password, or
   * Enter a custom secure password.

     <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2Fabz7YUQEbJE8pIOshs71%2Fimage.png?alt=media&#x26;token=18962be2-cbf6-4bf8-b1bc-e9ecb0994eeb" alt=""><figcaption></figcaption></figure>
9. Choose the desired **DB instance class** (e.g., `db.t3.medium`) based on performance needs.

   <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2F4uw12eoIQiG93Sb9eyPS%2Fimage.png?alt=media&#x26;token=e2785997-c853-4afd-9d28-456f93b0827a" alt=""><figcaption></figcaption></figure>
10. Configure **Storage type** and allocate a minimum of **100 GB**.<br>

    <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FGp7lMuJNi6D4S5RQ0Fk4%2Fimage.png?alt=media&#x26;token=03603aa8-51f2-458c-89ca-d193d64bade8" alt=""><figcaption></figcaption></figure>
11. Under **Connectivity**, configure VPC, subnet group, and security groups as required.<br>
12. Expand **Additional Configuration** and set any custom DB parameters.<br>

    <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FtkxUEM3HHV8jJzNJypdv%2Fimage.png?alt=media&#x26;token=436705b1-22d4-4d04-b113-4561274ee0bd" alt=""><figcaption></figcaption></figure>
13. Set **Public access** to **Yes** if remote connections are required.<br>

    <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FF8xPyaL4dzWtmPJMoA7U%2Fimage.png?alt=media&#x26;token=1c8b6ee4-cc1c-4711-95ed-6b9dfc7b0bb6" alt=""><figcaption></figcaption></figure>
14. Click **Create Database**.

### Create OvalEdge Schema

Once the RDS instance is available:

1. Copy the **endpoint** from the RDS dashboard.<br>

   <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FDAOucNclsgQAkQzOZZQh%2Fimage.png?alt=media&#x26;token=4211b0d2-2aa1-467c-882d-67dd4d2f366b" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2F9xmPru3b9ApQsXoRWkfv%2Fimage.png?alt=media&#x26;token=d6ba30c8-0edd-4da4-821f-4a124f3ff9e6" alt=""><figcaption></figcaption></figure>
2. Connect to the instance using a database client (e.g., MySQL CLI):

   ```bash
   mysql -h <rds-endpoint> -u <username> -p
   ```

## Download and Execute OvalEdge DB Scripts

1. Ensure the **OvalEdge DB scripts** are available on the EC2 instance (typically located under `$HOME/ovaledge/`).
2. Connect to the RDS instance using MySQL CLI:<br>

   ```bash
   mysql -h <rds-endpoint> -u <username> -p
   ```

   <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FDI6Li4snEysk9jgkxkEi%2Fimage.png?alt=media&#x26;token=93c09602-22ef-4661-9250-9dace0759357" alt=""><figcaption></figcaption></figure>
3. After logging in, execute the **master script**:<br>

   ```bash
   source /home/ec2-user/ovaledge/MasterScripts.sql;
   ```

   <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FciZSeqJ8YhN4E23HAMNt%2Fimage.png?alt=media&#x26;token=46ef6ae4-995b-41bb-9391-1b6583047d61" alt=""><figcaption></figcaption></figure>
4. Verify schema creation:

   ```sql
   show databases;
   ```

   The database **`ovaledgedb`** should be listed, confirming successful script execution.<br>

   <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2F3968Z06YJopZu5ajQWK0%2Fimage.png?alt=media&#x26;token=85a4697d-ff03-441c-83b9-313ed82eb6bd" alt=""><figcaption></figcaption></figure>

***

Copyright © 2025, OvalEdge LLC, Peachtree Corners, GA, USA.
