简体   繁体   中英

issues while connecting to RDS-aurora-mysql database

I have a RDS-Aurora(Mysql) database and I want to create tables inside this DB.

MyRequirment: I want to create tables inside RDS db using python.

I found one python-library to do this task: PyMySQL . PyMySQL helped me to create a table inside the RDS-DB.

if my RDS-DB is accessibly publicly, i can use PYMYSQL to connect to DB and create tables.

ISSUE My RDS-db is not publicly accessiable

How Can i connect to DB and create a table inside the RDS?

How Can i connect to DB and create a table inside the RDS?

There are three generally used solutions for that:

  1. Run your code from an instance in the same VPC as your private RDS.
  2. Use VPN (or Direct Connect if you have) to setup a connection between your home/work network and the VPC.
  3. Use ssh tunnel for ad-hoc connections between home/work workstation and the private RDS. For that you would need to have some jump host in a public subnet through which you can setup the tunnel.

The ssh tunnel is the easiest to setup and use for development and testing purposes. There are many tutorials explaining how to set it up:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM