To ensure the application works, we need to load data into the RDS instance.
We will use the SQL script in aws-fcj-container-app/database
to insert the data. To do this, first navigate to the aws-fcj-container-app/database
directory to get the script path:
cd aws-fcj-container-app/database
echo $PWD/init.sql
Copy the path as we will use it later.
Now, we’ll use the MySQL client installed earlier to connect to the RDS instance. First, go to the RDS Console:
Use the following command to connect:
mysql -h "rds-endpoint" -u admin -p
Next, we will use the source /home/ubuntu/aws-fcj-container-app/database/init.sql
command to run the SQL script. Paste the script path copied earlier and execute the command.
Check the database: SHOW DATABASES
Check the data: USE fcjresbar
then SELECT * FROM fcjresbar