Unsolved Connecting mysql server running on cloud aws on ubuntu
-
Unable to connect the mysql database running on cloud using aws. Please do provide a relevant information.
Thanks in advance
-
What did you try to connect?
Basically you can follow the example given here in the detailed description
-
@koahnig : I tried using the step mentioned in the link.
It works for me when i try to connect mysql database locally.
But comes with the message like " unable to connect to database" when i try to connect to remote database as mentioned running on AWS. -
@Kira maybe you should be more precise: how exactly did you try to connect?
You should post your code where you try to connect. -
Well, when you can do the same locally to a MySql database, there is no (Qt) reason, why you can't to an external DB. It does work the very same way in your application as far as I know. Assuming that all other credentials are the same you need only to change the host address.
As @jsulm notes your question was/is completely ambiguous. The six lines basically describe the required Qt source lines. Further down the descriptions are referring also to lastError() which is determining what the actual problem is.
In your case it might be your local firewall and/or the AWS firewall. You need to check if the AWS allows a connection for the port you are using as well you may have to open it for your ip address.
-
@jsulm and @koahnig : Thanks for your reply.
You were correct it was not issue related to qt.
Still would like to answer for any other user doing the
same.
Qt connects to any external database if it does with the local.
Here in case of aws there was issue in access rights of the database which does not
allowed any other application remotely to connect, so in that case we have to allow that users to allow external application to connect to the database.