com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure problems, however nothing seems to address my issue. Reading from some of Spring's documentation http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-sql.html I need spring.datasource.url, spring.datasource.username, and spring.datasource.password at the minimum to configure my mysql jdbc driver to point to my database. That is what I have done in my application.properties file yet I still have this problem. Even if I include spring.datasource.driver-class-name I still get the error. This is my first time trying to setup a database, so I am likely making one or more beginners mistakes. My stack trace: 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.

Stack Overflow | lordmichael95 | 4 months ago
  1. 0

    First time trying to setup a test database but gets com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

    Stack Overflow | 4 months ago | lordmichael95
    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure problems, however nothing seems to address my issue. Reading from some of Spring's documentation http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-sql.html I need spring.datasource.url, spring.datasource.username, and spring.datasource.password at the minimum to configure my mysql jdbc driver to point to my database. That is what I have done in my application.properties file yet I still have this problem. Even if I include spring.datasource.driver-class-name I still get the error. This is my first time trying to setup a database, so I am likely making one or more beginners mistakes. My stack trace: 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.
  2. 0

    boxfuse app can't connect to RDS database

    Stack Overflow | 8 months ago | mlr11
    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 634 milliseconds ago. The last packet sent successfully to the server was 631 milliseconds ago.
  3. 0

    confuse error if no mysql db is found

    GitHub | 1 year ago | AlvaroVega
    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure ! ! Last packet sent to the server was 0 ms ago.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Trouble deploying EJB application to JBoss when implementing persistence

    Stack Overflow | 6 years ago | ZeldaPinwheel
    org.jboss.util.NestedSQLException: Unable to get managed connection for MySqlDS; - nested throwable: (javax.resource.ResourceException: Unable to get managed connection for MySqlDS)
  6. 0

    NetBeans Forums - com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

    netbeans.org | 2 years ago
    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.

  1. WoodenDoors 1 times, last 9 months ago
  2. linxiaolong 2 times, last 4 weeks ago
  3. tvrmsmith 3 times, last 4 months ago
  4. linxiaolong 1 times, last 4 months ago
  5. DannyDBag 2 times, last 6 months ago
7 more registered users
5 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. com.mysql.jdbc.exceptions.jdbc4.CommunicationsException

    Communications link failure problems, however nothing seems to address my issue. Reading from some of Spring's documentation http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-sql.html I need spring.datasource.url, spring.datasource.username, and spring.datasource.password at the minimum to configure my mysql jdbc driver to point to my database. That is what I have done in my application.properties file yet I still have this problem. Even if I include spring.datasource.driver-class-name I still get the error. This is my first time trying to setup a database, so I am likely making one or more beginners mistakes. My stack trace: 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()
  2. Java RT
    Constructor.newInstance
    1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[na:1.8.0_92]
    2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)[na:1.8.0_92]
    3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[na:1.8.0_92]
    4. java.lang.reflect.Constructor.newInstance(Constructor.java:423)[na:1.8.0_92]
    4 frames
  3. MySQL jdbc
    JDBC4Connection.<init>
    1. com.mysql.jdbc.Util.handleNewInstance(Util.java:404)[mysql-connector-java-5.1.39.jar:5.1.39]
    2. com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:988)[mysql-connector-java-5.1.39.jar:5.1.39]
    3. com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:341)[mysql-connector-java-5.1.39.jar:5.1.39]
    4. com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2251)[mysql-connector-java-5.1.39.jar:5.1.39]
    5. com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2284)[mysql-connector-java-5.1.39.jar:5.1.39]
    6. com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2083)[mysql-connector-java-5.1.39.jar:5.1.39]
    7. com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:806)[mysql-connector-java-5.1.39.jar:5.1.39]
    8. com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)[mysql-connector-java-5.1.39.jar:5.1.39]
    8 frames
  4. Java RT
    Constructor.newInstance
    1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[na:1.8.0_92]
    2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)[na:1.8.0_92]
    3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[na:1.8.0_92]
    4. java.lang.reflect.Constructor.newInstance(Constructor.java:423)[na:1.8.0_92]
    4 frames
  5. MySQL jdbc
    NonRegisteringDriver.connect
    1. com.mysql.jdbc.Util.handleNewInstance(Util.java:404)[mysql-connector-java-5.1.39.jar:5.1.39]
    2. com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:410)[mysql-connector-java-5.1.39.jar:5.1.39]
    3. com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:328)[mysql-connector-java-5.1.39.jar:5.1.39]
    3 frames
  6. org.apache.tomcat
    DataSourceProxy.getConnection
    1. org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:310)[tomcat-jdbc-8.5.4.jar:na]
    2. org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:203)[tomcat-jdbc-8.5.4.jar:na]
    3. org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:716)[tomcat-jdbc-8.5.4.jar:na]
    4. org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:648)[tomcat-jdbc-8.5.4.jar:na]
    5. org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:468)[tomcat-jdbc-8.5.4.jar:na]
    6. org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:143)[tomcat-jdbc-8.5.4.jar:na]
    7. org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:118)[tomcat-jdbc-8.5.4.jar:na]
    8. org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:107)[tomcat-jdbc-8.5.4.jar:na]
    9. org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:131)[tomcat-jdbc-8.5.4.jar:na]
    9 frames
  7. Spring Framework
    DataSourceUtils.getConnection
    1. org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)[spring-jdbc-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    2. org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)[spring-jdbc-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    2 frames
  8. org.springframework.jdbc
    DatabasePopulatorUtils.execute
    1. org.springframework.jdbc.datasource.init.DatabasePopulatorUtils.execute(DatabasePopulatorUtils.java:46)[spring-jdbc-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    1 frame
  9. Spring Boot AutoConfigure
    DataSourceInitializer.init
    1. org.springframework.boot.autoconfigure.jdbc.DataSourceInitializer.runScripts(DataSourceInitializer.java:176)[spring-boot-autoconfigure-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    2. org.springframework.boot.autoconfigure.jdbc.DataSourceInitializer.runSchemaScripts(DataSourceInitializer.java:85)[spring-boot-autoconfigure-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    3. org.springframework.boot.autoconfigure.jdbc.DataSourceInitializer.init(DataSourceInitializer.java:77)[spring-boot-autoconfigure-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    3 frames
  10. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_92]
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_92]
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_92]
    4. java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_92]
    4 frames
  11. Spring Beans
    DefaultListableBeanFactory.getBean
    1. org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:365)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    2. org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:310)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    3. org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    6. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    7. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    8. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    9. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    10. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    11. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:220)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    12. org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:353)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    13. org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:334)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    13 frames
  12. Spring Boot AutoConfigure
    DataSourceInitializerPostProcessor.postProcessAfterInitialization
    1. org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerPostProcessor.postProcessAfterInitialization(DataSourceInitializerPostProcessor.java:62)[spring-boot-autoconfigure-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    1 frame
  13. Spring Beans
    AbstractBeanFactory.getBean
    1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:422)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    5. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    6. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    7. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    8. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    9. org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:207)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    10. org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1214)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    11. org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1054)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    12. org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1019)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    13. org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    14. org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    15. org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    16. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1143)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    17. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1046)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    18. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    19. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    20. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    21. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    22. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    23. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    24. org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:372)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    25. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    26. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    27. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    28. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    29. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    30. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    31. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    32. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    32 frames
  14. Spring Context
    AbstractApplicationContext.refresh
    1. org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1076)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    2. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:851)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    3. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    3 frames
  15. Spring Boot
    SpringApplication.run
    1. org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    2. org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    3. org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:369)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    4. org.springframework.boot.SpringApplication.run(SpringApplication.java:313)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    5. org.springframework.boot.SpringApplication.run(SpringApplication.java:1185)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    6. org.springframework.boot.SpringApplication.run(SpringApplication.java:1174)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    6 frames
  16. edu.demo
    SpringbootJdbcDemoApplication.main
    1. edu.demo.SpringbootJdbcDemoApplication.main(SpringbootJdbcDemoApplication.java:9)[classes/:na]
    1 frame
  17. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_92]
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_92]
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_92]
    4. java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_92]
    4 frames
  18. IDEA
    AppMain.main
    1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)[idea_rt.jar:na]
    1 frame