org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution

The issue

org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution issue happens when we tried to connect MySQL with our spring boot application.

Inside the application.properties we had to specify the MySQL server settings like this:

spring.datasource.url=jdbc:mysql://localhost:3306/springboot
spring.datasource.username=<username>
spring.datasource.password=<password>
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

The solution

In our case the settings were wrong. When we ran the spring boot with the wrong MySQL settings we got the following error:

org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution

As soon as we corrected the MySQL settings in the application.properties file, the error was gone. When we ran the spring boot it worked and MySQL was connected properly with our spring boot application.

If the above solution does not work for you, please check the following StackOverflow post.

Unable to open JDBC Connection for DDL execution

Share