I have created a ubuntu ec2 instance in AWS and installed the MySQL server. I've associated the instance with an elastic IP. I'm able to access the MySQL server with this address http://x.x.xxx.xx/phpmyadmin x.x.xxx.xx is my public elastic IP address. I want to access the MySQL database with my local Java application.
This is my java code
conn = DriverManager.getConnection("jdbc:mysql://ec2-x-x-xxx-xx.ap-south-1.compute.amazonaws.com:3306/userDB",
"root", "password");
I'm getting a "Communications link failure due to underlying exception" error.