how to connect web application deployed on elastic benstalk with mysql database instance on aws?How do I connect to a MySQL Database in Python?How to get a list of user accounts using the command line in MySQL?How to reset AUTO_INCREMENT in MySQL?How to get the sizes of the tables of a MySQL database?How do I import an SQL file using the command line in MySQL?Elastic Beanstalk Hibernate MySQLElastic Beanstalk app won't connect to RDS MySQL instancePermissions for EC2 created by Elastic Beanstalk connecting to external RDSElastic Beanstalk Application Can't Connect to Database but Server Can502 Bad Gateway when deploying Spring Boot application to Elastic Beanstalk

What is this geomorphological feature?

What is this green alien supposed to be on the American covers of the "Hitchhiker's Guide to the Galaxy"?

Difference between c++14 and c++17 using: `*p++ = *p`

When designing an adventure, how can I ensure a continuous player experience in a setting that's likely to favor TPKs?

How to remove the first colon ':' from a timestamp?

Which GPUs to get for Mathematical Optimization (if any)?

Should I use a resistor between the gate driver and MOSFET (gate pin)?

Is this Android phone Android 9.0 or Android 6.0?

I want to identify a part from a photo

How to find location on Cambridge-Mildenhall railway that still has tracks/rails?

Alphanumeric Line and Curve Counting

May I use a railway velocipede on used British railways?

An entire function all whose forward orbits are bounded

Why won't some unicode characters print to my terminal?

What would be the safest way to drop thousands of small, hard objects from a typical, high wing, GA airplane?

numbering overwrites equation

Why is Google approaching my VPS machine?

Why is the Intel 8086 CPU called a 16-bit CPU?

Why a binary file is not shown as 0 and 1?

Why did Fury respond that way?

How is Buchholz score calculated in a Swiss tournament?

Grouping into more groups in one iteration

"Je suis petite, moi?", purpose of the "moi"?

How did Jayne know when to shoot?



how to connect web application deployed on elastic benstalk with mysql database instance on aws?


How do I connect to a MySQL Database in Python?How to get a list of user accounts using the command line in MySQL?How to reset AUTO_INCREMENT in MySQL?How to get the sizes of the tables of a MySQL database?How do I import an SQL file using the command line in MySQL?Elastic Beanstalk Hibernate MySQLElastic Beanstalk app won't connect to RDS MySQL instancePermissions for EC2 created by Elastic Beanstalk connecting to external RDSElastic Beanstalk Application Can't Connect to Database but Server Can502 Bad Gateway when deploying Spring Boot application to Elastic Beanstalk






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I have a web application deployed on elastic beanstalk. I have configured MySQL database for it. In database instance in security group i have done following changes: Type(MYSQL/Aurora), protocol(TCP), port range(3306) and source(0.0.0.0/0).
when i am trying to insert data into database using web application or fetch data from database using web application which is deployed on elastic beanstalk, i am not able to do it.
I have made changes in servlet code as mentioned on aws website but connection is not establishing between web application and RDS on aws.
I don't know where i am doing the mistake. please help me to achieve it.










share|improve this question






















  • what is the issue you facing ? Any logs ?

    – Mebin Joe
    Mar 26 at 9:22











  • when web application is deployed on elastic beanstalk it is not connecting to aws RDS instance. But when it is running on localhost then it is connecting to aws RDS instance.

    – Nishant Kumar
    Mar 26 at 9:45

















2















I have a web application deployed on elastic beanstalk. I have configured MySQL database for it. In database instance in security group i have done following changes: Type(MYSQL/Aurora), protocol(TCP), port range(3306) and source(0.0.0.0/0).
when i am trying to insert data into database using web application or fetch data from database using web application which is deployed on elastic beanstalk, i am not able to do it.
I have made changes in servlet code as mentioned on aws website but connection is not establishing between web application and RDS on aws.
I don't know where i am doing the mistake. please help me to achieve it.










share|improve this question






















  • what is the issue you facing ? Any logs ?

    – Mebin Joe
    Mar 26 at 9:22











  • when web application is deployed on elastic beanstalk it is not connecting to aws RDS instance. But when it is running on localhost then it is connecting to aws RDS instance.

    – Nishant Kumar
    Mar 26 at 9:45













2












2








2








I have a web application deployed on elastic beanstalk. I have configured MySQL database for it. In database instance in security group i have done following changes: Type(MYSQL/Aurora), protocol(TCP), port range(3306) and source(0.0.0.0/0).
when i am trying to insert data into database using web application or fetch data from database using web application which is deployed on elastic beanstalk, i am not able to do it.
I have made changes in servlet code as mentioned on aws website but connection is not establishing between web application and RDS on aws.
I don't know where i am doing the mistake. please help me to achieve it.










share|improve this question














I have a web application deployed on elastic beanstalk. I have configured MySQL database for it. In database instance in security group i have done following changes: Type(MYSQL/Aurora), protocol(TCP), port range(3306) and source(0.0.0.0/0).
when i am trying to insert data into database using web application or fetch data from database using web application which is deployed on elastic beanstalk, i am not able to do it.
I have made changes in servlet code as mentioned on aws website but connection is not establishing between web application and RDS on aws.
I don't know where i am doing the mistake. please help me to achieve it.







java mysql servlets amazon-rds amazon-elastic-beanstalk






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 26 at 9:21









Nishant KumarNishant Kumar

113 bronze badges




113 bronze badges












  • what is the issue you facing ? Any logs ?

    – Mebin Joe
    Mar 26 at 9:22











  • when web application is deployed on elastic beanstalk it is not connecting to aws RDS instance. But when it is running on localhost then it is connecting to aws RDS instance.

    – Nishant Kumar
    Mar 26 at 9:45

















  • what is the issue you facing ? Any logs ?

    – Mebin Joe
    Mar 26 at 9:22











  • when web application is deployed on elastic beanstalk it is not connecting to aws RDS instance. But when it is running on localhost then it is connecting to aws RDS instance.

    – Nishant Kumar
    Mar 26 at 9:45
















what is the issue you facing ? Any logs ?

– Mebin Joe
Mar 26 at 9:22





what is the issue you facing ? Any logs ?

– Mebin Joe
Mar 26 at 9:22













when web application is deployed on elastic beanstalk it is not connecting to aws RDS instance. But when it is running on localhost then it is connecting to aws RDS instance.

– Nishant Kumar
Mar 26 at 9:45





when web application is deployed on elastic beanstalk it is not connecting to aws RDS instance. But when it is running on localhost then it is connecting to aws RDS instance.

– Nishant Kumar
Mar 26 at 9:45












1 Answer
1






active

oldest

votes


















0














Please follow the below steps to connect the mysql instance from web application:



  • Copy the Endpoint from the RDS instance which will be the hostname
    for your mysql database.

  • SSH into the EC2-Instance


  • Use mysql to connect to the RDS instance using the following command:



    mysql -u username -p -h HOSTNAME




where HOSTNAME is the endpoint of your RDS instance.



Also, you have mentioned you have inbound all the traffic in the VPC security groups. This is not the recommended way to connect to a database.Database should always be secured from the outside world.
You have to explicitly mention the source from where the connections will be coming.

Eg:

   Type                Protocol   Port Range      Source  

MySQL/Aurora     TCP       3306         security group id of the application






share|improve this answer

























  • I have already tried this. It's not working. What all changes i'll have to do in my java servlet code to connect to RDS instance?

    – Nishant Kumar
    Mar 26 at 17:22










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55353556%2fhow-to-connect-web-application-deployed-on-elastic-benstalk-with-mysql-database%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Please follow the below steps to connect the mysql instance from web application:



  • Copy the Endpoint from the RDS instance which will be the hostname
    for your mysql database.

  • SSH into the EC2-Instance


  • Use mysql to connect to the RDS instance using the following command:



    mysql -u username -p -h HOSTNAME




where HOSTNAME is the endpoint of your RDS instance.



Also, you have mentioned you have inbound all the traffic in the VPC security groups. This is not the recommended way to connect to a database.Database should always be secured from the outside world.
You have to explicitly mention the source from where the connections will be coming.

Eg:

   Type                Protocol   Port Range      Source  

MySQL/Aurora     TCP       3306         security group id of the application






share|improve this answer

























  • I have already tried this. It's not working. What all changes i'll have to do in my java servlet code to connect to RDS instance?

    – Nishant Kumar
    Mar 26 at 17:22















0














Please follow the below steps to connect the mysql instance from web application:



  • Copy the Endpoint from the RDS instance which will be the hostname
    for your mysql database.

  • SSH into the EC2-Instance


  • Use mysql to connect to the RDS instance using the following command:



    mysql -u username -p -h HOSTNAME




where HOSTNAME is the endpoint of your RDS instance.



Also, you have mentioned you have inbound all the traffic in the VPC security groups. This is not the recommended way to connect to a database.Database should always be secured from the outside world.
You have to explicitly mention the source from where the connections will be coming.

Eg:

   Type                Protocol   Port Range      Source  

MySQL/Aurora     TCP       3306         security group id of the application






share|improve this answer

























  • I have already tried this. It's not working. What all changes i'll have to do in my java servlet code to connect to RDS instance?

    – Nishant Kumar
    Mar 26 at 17:22













0












0








0







Please follow the below steps to connect the mysql instance from web application:



  • Copy the Endpoint from the RDS instance which will be the hostname
    for your mysql database.

  • SSH into the EC2-Instance


  • Use mysql to connect to the RDS instance using the following command:



    mysql -u username -p -h HOSTNAME




where HOSTNAME is the endpoint of your RDS instance.



Also, you have mentioned you have inbound all the traffic in the VPC security groups. This is not the recommended way to connect to a database.Database should always be secured from the outside world.
You have to explicitly mention the source from where the connections will be coming.

Eg:

   Type                Protocol   Port Range      Source  

MySQL/Aurora     TCP       3306         security group id of the application






share|improve this answer















Please follow the below steps to connect the mysql instance from web application:



  • Copy the Endpoint from the RDS instance which will be the hostname
    for your mysql database.

  • SSH into the EC2-Instance


  • Use mysql to connect to the RDS instance using the following command:



    mysql -u username -p -h HOSTNAME




where HOSTNAME is the endpoint of your RDS instance.



Also, you have mentioned you have inbound all the traffic in the VPC security groups. This is not the recommended way to connect to a database.Database should always be secured from the outside world.
You have to explicitly mention the source from where the connections will be coming.

Eg:

   Type                Protocol   Port Range      Source  

MySQL/Aurora     TCP       3306         security group id of the application







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 26 at 10:45

























answered Mar 26 at 10:06









Aress SupportAress Support

8071 silver badge11 bronze badges




8071 silver badge11 bronze badges












  • I have already tried this. It's not working. What all changes i'll have to do in my java servlet code to connect to RDS instance?

    – Nishant Kumar
    Mar 26 at 17:22

















  • I have already tried this. It's not working. What all changes i'll have to do in my java servlet code to connect to RDS instance?

    – Nishant Kumar
    Mar 26 at 17:22
















I have already tried this. It's not working. What all changes i'll have to do in my java servlet code to connect to RDS instance?

– Nishant Kumar
Mar 26 at 17:22





I have already tried this. It's not working. What all changes i'll have to do in my java servlet code to connect to RDS instance?

– Nishant Kumar
Mar 26 at 17:22








Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55353556%2fhow-to-connect-web-application-deployed-on-elastic-benstalk-with-mysql-database%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해