Migrating a Mysql maria db Database to Amazon RDS Maria DB



Module 5 Challenge Lab
In this video you will learn:

After completing this Video, you should be able to:

1. Create an RDS database instance
2. Export data from MariaDB database by using mysqldump
3. Connect a SQL client to an RDS database.
4. Migrate data from a MariaDB database that runs on an EC2 instance to an RDS database instance
5. Configure a web application to use the new RDS database instance for data storage

At the prompt, enter the following commands:
bash
sudo su
su ec2-user
whoami
cd /home/ec2-user/

————–
service mariadb status
mysql –version
————–
mysql -u root -p
—————
show databases;
use cafe_db;
show tables;
select * from `order`;
exit
=========—————-
Capture existing data in a file by using the mysqldump utility:
“mysqldump –databases cafe_db -u root -p CafeDbDump.sql”
cat CafeDbDump.sql
————-
connect to RDS db:
mysql -u admin -p –host rds-endpoint
—————
check enpoint connectivity
nmap -Pn rds-endpoint

——————-
To import the data, in the terminal, run the following command (where rds-endpoint is the actual endpoint):
mysql -u admin -p –host rds-endpoint CafeDbDump.sql

—————

To connect to the RDS database, run this command:
mysql -u admin -p –host rds-endpoint

—————-
To confirm that the data was imported, run the following command:
show databases;
use cafe_db;
show tables;
select * from `order`;

—————–
sudo service mariadb stop

AWS
DevOps
AWS solution arcchitect

source

Leave a Comment