Retrieve the Public IP address of the EC2 instance.
Use MobaXterm to connect to the instance via SSH on port 22:
The result after SSH.
We use Git to clone the source code. First, install Git using the following command:
sudo yum install git
Install MySQL command-line client
sudo dnf install mariadb105
Check if the installation was successful.
mysql --version
Connect to the MySQL command-line client (unencrypted)
mysql -h fcj-management-db-instance.cdysiiecu90g.ap-southeast-1.rds.amzonaws.com -P 3306 -u admin -p
Successfully connected to the DB instance. Proceed to check the databases within the instance using the command, which will display a list of all databases.
SHOW DATABASES;
Select the database to make changes by using the USE command; use the initial database that you created when setting up the RDS.
USE "name of database";
Create a table in the awsuser database using the CREATE TABLE command.
CREATE TABLE `awsfcjuser`.`user` ( `id` INT NOT NULL AUTO_INCREMENT , `first_name` VARCHAR(45) NOT NULL , `last_name` VARCHAR(45) NOT NULL , `email` VARCHAR(45) NOT NULL , `phone` VARCHAR(45) NOT NULL , `comments` TEXT NOT NULL , `status` VARCHAR(10) NOT NULL DEFAULT 'active' , PRIMARY KEY (`id`)) ENGINE = InnoDB;
Insert information into the table using the INSERT INTO command
INSERT INTO `user`
(`id`, `first_name`, `last_name`, `email`, `phone`, `comments`, `status`) VALUES
(NULL, 'Amanda', 'Nunes', 'anunes@ufc.com', '012345 678910', '', 'active'),
(NULL, 'Alexander', 'Volkanovski', 'avolkanovski@ufc.com', '012345 678910', '', 'active'),
(NULL, 'Khabib', 'Nurmagomedov', 'knurmagomedov@ufc.com', '012345 678910', '', 'active'),
(NULL, 'Kamaru', 'Usman', 'kusman@ufc.com', '012345 678910', '', 'active'),
(NULL, 'Israel', 'Adesanya', 'iadesanya@ufc.com', '012345 678910', '', 'active'),
(NULL, 'Henry', 'Cejudo', 'hcejudo@ufc.com', '012345 678910', '', 'active'),
(NULL, 'Valentina', 'Shevchenko', 'vshevchenko@ufc.com', '012345 678910', '', 'active'),
(NULL, 'Tyron', 'Woodley', 'twoodley@ufc.com', '012345 678910', '', 'active'),
(NULL, 'Rose', 'Namajunas ', 'rnamajunas@ufc.com', '012345 678910', '', 'active'),
(NULL, 'Tony', 'Ferguson ', 'tferguson@ufc.com', '012345 678910', '', 'active'),
(NULL, 'Jorge', 'Masvidal ', 'jmasvidal@ufc.com', '012345 678910', '', 'active'),
(NULL, 'Nate', 'Diaz ', 'ndiaz@ufc.com', '012345 678910', '', 'active'),
(NULL, 'Conor', 'McGregor ', 'cmcGregor@ufc.com', '012345 678910', '', 'active'),
(NULL, 'Cris', 'Cyborg ', 'ccyborg@ufc.com', '012345 678910', '', 'active'),
(NULL, 'Tecia', 'Torres ', 'ttorres@ufc.com', '012345 678910', '', 'active'),
(NULL, 'Ronda', 'Rousey ', 'rrousey@ufc.com', '012345 678910', '', 'active'),
(NULL, 'Holly', 'Holm ', 'hholm@ufc.com', '012345 678910', '', 'active'),
(NULL, 'Joanna', 'Jedrzejczyk ', 'jjedrzejczyk@ufc.com', '012345 678910', '', 'active');
Use the SELECT command to display the table.
SELECT * FROM user;
Use exit to leave. If you are unable to disconnect from the DB instance, use the key combination Ctrl+C.