Unable to create requested service [org.hibernate .engine.jdbc.env.spi.JdbcEnvironment]-MySQL

前端 未结 6 1671
眼角桃花
眼角桃花 2021-02-15 17:54

I am a newbie to Hibernate. I am currently using Spring boot framework and trying to create database tables through hibernate.

I know the same question is asked before b

6条回答
  •  悲哀的现实
    2021-02-15 18:32

    Upgrade MySql driver to mysql-connector-java - 8.0.17 and

    Those who are using greater than MySQL 5.5 version

    change their driver property

    from com.mysql.jdbc.Driver to com.mysql.cj.jdbc.Driver

    because:

    Loading class com.mysql.jdbc.Driver. This is deprecated. The new driver class is com.mysql.cj.jdbc.Driver. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.INFO - HHH000401: using driver [com.mysql.jdbc.Driver] at URL....

    in hibernate.properties

    hibernate.connection.driver_class = com.mysql.cj.jdbc.Driver
    

    or if you are using hibernate.cfg.xml update

    com.mysql.cj.jdbc.Driver
    

提交回复
热议问题