Reputation: 63
this is my first time using anything AWS-related.
I have a war containing a Grails 2.1.1 app. The DataSource.groovy was compiled to use the
url = System.getProperty("JDBC_CONNECTION_STRING")
method of retrieving the db connection string.
In my EC2 environment configuration, under the Container tab, I have the following value for JDBC_CONNECTION_STRING, which has the correct details for my RDS instance:
jdbc:mysql://aatxmz44i5auf0.cqp6ibnaxohn.eu-west-1.rds.amazonaws.com/ebdb?user=myusername&password=mypassword
Note that "mysername" does not equal 'sa'.
After application startup, the snapshot logs come back with a stack trace error with the following root cause:
Caused by: java.sql.SQLException: Access denied for user 'sa'@'ip-10-226-5-172.eu-west-1.compute.internal' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4096)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:951)
at ...
Any idea as to why my specifies JDBC connection URL isn't working. I used these instructions to configure & deploy my app.
All help greatly appreciated.
Donovan
Upvotes: 1
Views: 3675
Reputation: 1141
I had the same problem. For me the issue was special chars in the pwd. For testing try updating the pwd and skipping all special chars from it. It should work fine after it. I was able to resolve it with this solution.
Upvotes: 0
Reputation: 343
Process of elimination. Have you tried to connect to the RDS from the EC2 terminal?
mysql -h aatxmz44i5auf0.cqp6ibnaxohn.eu-west-1.rds.amazonaws.com -u myusername -p
Upvotes: 2
Reputation: 44244
You'll need to create RDS db security groups, per the Amazon docs. A properly configured group will let you hit the RDS instance via mysql or telnet from your Grails server:
mysql -h <rds_endpoint> -umy_username -pmy_password
Upvotes: 0