title: Remote database not connecting with Java app
body: <p>I have a java project and for that, I needed a remote database, I purchased a aws instance for public IP, installed MySql with PhpMyAdmin but the database is not connecting with the project via my public IP but if I use a ngrok port forward then it is connecting with the database, and the error its producting is:</p>
  <pre><code>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.
  </code></pre>
  <p>please help!!</p>
  <p><a href="https://i.stack.imgur.com/0jNvB.png" rel="nofollow noreferrer">Working with Ngrok</a></p>
  <p><a href="https://i.stack.imgur.com/jQzPZ.png" rel="nofollow noreferrer">Not working with public ip</a></p>