AWS RDS CodeDeploy Connection Failure - mysql

I made CICD pipeline with Codedeploy, ec2 and s3 and it is successful.
and then I attach rds to the pipeline but I failed.
AWS RDS works well in local program, but when Spring deploy in EC2, the connection with RDS is not working
This is message
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
Caused by: java.net.ConnectException: Connection refused
This is my ec2 and rds security inbound
ec2 :
rds :
Many people say that add ec2 security group to rds security group, but already I did and problem is not solving.
What is real problem?
I close all firewall of my computer

Related

Play framework 1.x migration to last version : Communications link failure / SSL peer shut down incorrectly

I try to upgrade my app using Play Framework 1.3.1 to last version 1.7.1. I have this error :
~ ERROR: java version prior to 11 are no longer supported: current version "1.8.0_311" : please update
Exception in thread "main" java.lang.UnsupportedClassVersionError: play/classloading/HotswapAgent has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
I have upgraded my Java to jdk-11.0.17, my server can start, but displaying the home Web page, I have this error :
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
17:43:23.519 [play-thread-1] ERROR play - Database [default] Cannot connected to the database : Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
...
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
...
Caused by: javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
...
Caused by: java.io.EOFException: SSL peer shut down incorrectly
My app is configure to connect to local MySql version 5.5.62.
I have tried with Java 17 or 19 without success.
I have done many searches on internet but I cannot find any help or solution.
I cannot find which Java version I have to use with Play 1.7.1.
Thanks for any help or suggestions,
Xavier

Cannot perform remote access to Mysql using domain name

I installed a new mysql server into an amazon ec2 instance. My instance is configured with a domain name protected by an amazon ssl.
All works perfectly:
My wordpress is running under an https.
I configured mysql to perform remote connection and I can connect to it with intellij using the IP_adress:3306
But I can't connect to remotely using the domain name:
This is how I configured the url into intellij: jdbc:mysql://mysiteweb.com:3306
And this is what i obtain as error:
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
java.net.ConnectException: Connection refused (Connection refused).
Have you point your domain to the server's IP address ?

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server

This project was successfully deployed in studio. But when I deploy in cloudhub it shows the error. I am using mysql database. Can any one solve?
org.mule.module.db.internal.domain.connection.ConnectionCreationException: Cannot get connection for URL jdbc:mysql://127.0.0.1:3306/company : Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. (java.sql.SQLException) (org.mule.module.db.internal.processor.DbConnectionException).
You are trying to connect to a MySQL database in your computer. That worked in Studio because you had the database running there. In the CloudHub deployment there is not, and will never be, a database running. You need to change the JDBC URL to point to a real database that is somewhere else and it is actually accessible from your CloudHub deployed application. That is something you need to resolve, not a problem with CloudHub.

JDBC exception while connecting to remote database

I have a spring project which connects to remote MySQL database and displays data from it. The app was tested in Eclipse on tomcat localhost server and there were no problems. later on, I extracted the project in .war format and uploaded it on openshift.com server, and it worked for more than 2 weeks. But suddenly, now I get this error when I open it on that server:
HTTP Status 500 - Request processing failed; nested exception is java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
type Exception report
message Request processing failed; nested exception is java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
I immediately opened the same project in Eclipse (connected to that online database) and there was no error. I extracted the app in new .war file and deleted the old one on the server and replaced it with new one. And guess what, still the same exception occurs.
So basically, I have one application, which connects to remote database, and it works fine when I run it on localhost, but suddenly does not work when I put it on some hosting server (it was working on that server for some good time which is weird).
What could have gone wrong?

Connecting to a local SQL server from a website

We have a small network behind a firewall (WatchGuard XTM 2 series) and network switch. On our network we have multiple instances of SQL server, but 1 in specific that I would like to be able to access remotely from our website. We have a static IP address from our ISP and then all the machines on the network have a locally assigned dynamic IP address. When trying to connect to the database from outside our network how do I get the request to be directed to the proper machine / SQL instance? Is it a parameter in my connection string or something in my firewall?
A few things to rule out:
1) The firewall is allowing access from the website to our network. I added the site's IP and opened up port 1433. Also, when trying to connect and monitoring the firewall no exceptions come up as they did before I added the proper IP address.
2) Remote connections on the SQL server has been setup and enabled. I've done a lot of reading up on remote connections and I am sure it has been setup properly.
I am currently getting this error message on my site:
A network-related or instance-specific
error occurred while establishing a
connection to SQL Server. The server
was not found or was not accessible.
Verify that the instance name is
correct and that SQL Server is
configured to allow remote
connections. (provider: TCP Provider,
error: 0 - A connection attempt failed
because the connected party did not
properly respond after a period of
time, or established connection failed
because connected host has failed to
respond.)
The Server parameter of the ConnectionString indicates what server to connect to. Assign an ip address or URL to the server that you want to access and put that in your connection string.