1

I am getting this error when connecting to the mysql database through Spring hibernate in ubunto 14.4. This is working on My local environment perfectly.

Nov 09, 2014 2:37:27 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
WARN: SQL Error: 0, SQLState: 08S01
Nov 09, 2014 2:37:27 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: Communications link failure

can anyone help me out to solve this?

Piusha
  • 594
  • 5
  • 11

1 Answers1

0

I had a similar problem. I was with Spring Boot and these configurations in the application.properties file resolved the problem:

spring.datasource.testWhileIdle = true
spring.datasource.timeBetweenEvictionRunsMillis = 3600000
spring.datasource.validationQuery = SELECT 1

Hope can be helpful for someone else.

See here for more info: http://blog.netgloo.com/2015/07/09/spring-boot-communications-link-failure-with-mysql-and-hibernate/

Community
  • 1
  • 1
Andrea
  • 15,900
  • 18
  • 65
  • 84