Create an RDS Instance

In order for MyCRT to run, it needs its own MySQL database. We will create one hosted on RDS.

1: Launch an RDS Instance

From the RDS instance dashboard, click "Launch Instance".

Select MySQL for the engine, select Dev/Test - MySQL for the use case, select mysql 5.7.21, select the db.t2.micro instance class, provide an instance identifier, master username, master password, and click "next". Change "Publicly Accessible" to "No" - this will require your EC2 instance and RDS instance to be in the same VPC. Click "Launch Instance", and your instance will be created!

Finally, modify the DB security group inbound rules to allow TCP on port 3306 from anywhere.

2: Create the MyCRT Tables

Now, we need to initialize the database for MyCRT. This will all be done inside an SSH into the EC2 instance we have set up.

First, we need to make sure that we can access the new RDS instance from our EC2 instance. Run the following command to connect:

mysql -h YOUR_RDS_INSTANCE_ENDPOINT -u MASTER_USERNAME -p

and enter the master password. You should now have a connection. Go ahead and close it for now.

To configure MyCRT to use the database, make the following files:

  • mycrt/scripts/db/config/demo.cnf

[client]
user=MASTER_USERNAME
password=MASTER_PASSWORD
  • mycrt/scripts/db/config/demo.config.json

{
    "database": "LBTMyCRT",
    "host": "YOUR_RDS_INSTANCE_HOSTNAME",
    "password": "MASTER_PASSWORD",
    "user": "MASTER_USER"
}

Create the MyCRT database by running:

cd mycrt/scripts/db
mysql --defaults-file="config/demo.cnf" -h YOUR_RDS_INSTANCE_HOSTNAME < mycrt.sql

There should be no failure.

Next Step

pageConfigure and Launch MyCRT

Last updated