- Should create RDS DB and have endpoint, username & password ready
- Create a database, table and insert some records
- Should have EC2 instance running with output file directory and this python program
- sudo yum update
- sudo yum install python3-pip
- pip3 install mysql-connector-python
- sudo yum install mysql
- sudo yum install python3-boto3
- pip3 install pymysql
- Optionally you can give below mysql command to connect to mysql and run quries (instead of running in sqlelectron)
mysql -u admin -p -h database-1.cluster-ro-clk1drfaf3ne.ap-northeast-1.rds.amazonaws.com -P 3306
Now place the program into EC2 instance and execute the program by giving below command
python3 rds-select.py
Now validate the output file
Make sure security group in RDS instance is open to all (0.0.0.0/0)