连接到RDS数据库实例

时间:2013-11-10 01:41:46

标签: java mysql amazon-web-services amazon-cloudfront amazon-rds

在连接到我的RDS数据库实例后,如何通过Eclipse连接到它并在我的数据库上创建表(使用Java代码而不是Eclipse API)。

CreateDBInstanceRequest createDBInstanceRequest = new CreateDBInstanceRequest()
        .withEngine("MySQL")
        .withLicenseModel("general-public-license")
        .withEngineVersion("5.6.13")
        .withDBInstanceClass("db.t1.micro")
        .withMultiAZ(false)
        .withAutoMinorVersionUpgrade(true)
        .withAllocatedStorage(5)
        .withDBInstanceIdentifier("mydbinstance")
        .withMasterUsername("master")
        .withMasterUserPassword("password")
        .withDBName("dbname")
        .withPort(3306);

        DBInstance dbInstance = rds.createDBInstance(createDBInstanceRequest);

        DescribeDBInstancesRequest instRequest = new DescribeDBInstancesRequest();
        DescribeDBInstancesResult instResult = new DescribeDBInstancesResult();
        Endpoint e = dbInstance.getEndpoint();

我是否需要下载mySQL连接器?

1 个答案:

答案 0 :(得分:0)

您可以尝试本指南,向您展示如何在实例化后使用Eclipse连接实例 - http://docs.aws.amazon.com/AWSToolkitEclipse/latest/GettingStartedGuide/tke_rds.html