Home > Blockchain >  how to set proper inbound rules to connect Julia to RDS MySQL db
how to set proper inbound rules to connect Julia to RDS MySQL db

Time:05-30

these fields are correctly set, and should be connecting me to the RDS database on aws.

con = DBInterface.connect(MySQL.Connection,
                            "database-1.cgeimvvh4qwz.us-east-1.rds.amazonaws.com",
                            "admin", "Baya2022", db="database-1")

Im wondering if it has something to do with the security group? i think i need to set it to my local ip address, but im not sure how.

CodePudding user response:

In order to connect to AWS RDS you need to:

  1. Enable public RDS access in AWS Management Console

    enter image description here

  2. Properly configure Security Group (I use here an unrestricted public access which is something not recommended) enter image description here

Note that

  • both steps are required
  • in a production environment you would rather use an SSH tunnel - publishing a public RDS endpoint is considered a security hole

Once you are done note that you have used database-1 which is the default DB Identifier in AWS. However - this is something totally different than the database name! Hence you need to create a database named database-1 first.

Or for testing you can use the system mysql database which always gets created such as:

julia> con = DBInterface.connect(MySQL.Connection,
                                   "database-1.cez1pkekt7fj.us-east-2.rds.amazonaws.com",
                                   "admin", "admin123", db="mysql")
MySQL.Connection(host="database-1.cez1pkekt7fj.us-east-2.rds.amazonaws.com", user="admin", port="3306", db="mysql")

It is however not recommended to store the data there (create your own database).

  • Related