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:
Enable public RDS access in AWS Management Console
Properly configure Security Group (I use here an unrestricted public access which is something not recommended)
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).