sparkandshine sparkandshine - 5 months ago 23
MySQL Question

How do I get the database url of AWS EC2 MySQL?

I would like to import gtfs files into mysql by using a tool from github, runing the follwoing command:

gtfsdb-load --database_url <db url> <gtfs file | url>


How can I get the
database_url
of mysql located in AWS EC2?

Answer

If you're running MySQL on AWS EC2 as an RDS instance, your database_url will be the RDS instance name (followed by :port of course).

See http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToInstance.html for more info, but this is normally of the form myinstance.123456789012.us-east-1.rds.amazonaws.com (where us-east-1 is the region in this example but might vary depending on your setup).

Alternatively, if you're running your own MySQL installation on an EC2 instance, you'll need to use your instance's public IP address or external DNS hostname. See http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addresses for more info on this. If you're doing this, you will have to have permitted ingress to your instance on the MySQL port, using Security Groups.