title: AWS RDS connection database error : com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
body: <p>I am trying to deploy my springboot application on an AWS linux instance however i keep getting the following error :</p>
  
  <pre><code>2018-04-24 18:15:27.777  INFO 24020 --- [ost-startStop-1] 
  
  o.s.b.w.servlet.ServletRegistrationBean  : Mapping servlet: 'dispatcherServlet' to [/]
  2018-04-24 18:15:28.771 ERROR 24020 --- [main] o.a.tomcat.jdbc.pool.ConnectionPool: Unable to create initial connections of pool.
  
  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.
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_161]
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_161]
  
  ... 
  
  2018-04-24 16:58:57.522  WARN 23780 --- [main] o.s.b.a.orm.jpa.DatabaseLookup : Unable to determine jdbc url from datasource
  
  org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta data; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: 
  Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
  </code></pre>
  
  <p>This is how i created my applications.properties file :</p>
  
  <pre><code>#database config
  spring.jpa.hibernate.ddl-auto=update
  spring.datasource.url=jdbc:mysql://****-west-1.rds.amazonaws.com:3306/DevManagementDB
  spring.datasource.username=root
  spring.datasource.password=mypassword
  spring.datasource.driver-class-name=com.mysql.jdbc.Driver
  spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
  spring.jpa.hibernate.ddl-auto=update
  </code></pre>
  
  <p>The strange part is that i can connect to my RDS database from this springboot application when i am running the application on my local machine. As soon as i try to deploy the application to the linux instance on AWS it fails and i get the above errors.</p>