connecting to amazon rds

i am trying to connect to a Amazon RDS MSQL instance. the host name is very long “testsql.cuzkoixitkplr.us-west-2.rds.amazonaws.com:3306” xojo only seem to allow host names that are ip addresses.

any thoughts on this?

I am unsure about using MSQL, but to get an IP address of a hostname, take a peek at: LookupDNSAddress

Hm, I copied the wrong link, You want: LookupIPAddress , sorry about that.

Are you leaving the “:3306” part in the host name? If so that would cause a problem connecting. You should be setting the port via the .port property.

Check the security group you assigned to your endpoint, maybe your problem is there.

The name pointed is: testsql.cuzkoixitkplr.us-west-2.rds.amazonaws.com
3306 is just the port assigned.

The address you posted looks normal (if valid) and as others have said assign 3306 to the port property.
The Host property will take either an IP or a hostname and still work.
I am currently testing load balancing with AWS RDS and it works a treat :slight_smile:
Now I just have to cut over to Xojo :confused:
I am sure it will be straight forward though… if different at all.

I am using this. not working. security group is set to default.

mDb.Host = “testsql.cuzkoixitkplr.us-west-2.rds.amazonaws.com
mDb.UserName = “user”
mDb.Password = “pword”
mDB.Port=3306
mDb.DatabaseName = “test”

Assuming mDB is a property in a window or the App itself;

initialise mDB in app.open or mywindow.open

mDB = new MySQLCommunityServer //unless the name has changed in Xojo?

Then connect to the DB;

if mDB.connect then msgbox "woohoo I connected" //add code here else msgbox "I messed something up" end if

I think there is a good example in the examples folder.

If you modify the code above to the following

if mDB.connect then msgbox "woohoo I connected" //add code here else msgbox mDB.errorMessage end if

It will give you some idea of where you are bombing out.

For security reasons, the default security group could be disabling access to your DB instances. As I told, I believe your problem is there. The best practices tells us to not use the defaults and create proper ones to our cases. If you want your applications to access your DB instance you can allow access from EC2 instances belonging to specific EC2 security groups or IP ranges. Once ingress is configured, the same rules apply to all DB instances that are associated with that EC2 security group.

Each DB security group rule enables a specific source to access a DB instance that is associated with that DB security group. The source can be a range of addresses (e.g., 222.3.44.0/24), or an EC2 security group. When you specify an EC2 security group as the source, you allow incoming traffic from all EC2 instances that use that EC2 security group. Note that DB security group rules apply to inbound traffic only; outbound traffic is not permitted for RDS DB instances.

You do not need to specify a destination port number when you create DB security group rules; the port number defined for the DB instance is used as the destination port number for all rules defined for the DB security group. DB security groups can be created using the AWS Management Console.

Read more here: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithSecurityGroups.Authorizing.html

thanks. it was the security group. connected now.