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

前端 未结 6 1670
眼角桃花
眼角桃花 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:50

    You need to add mysql JDBC jar in your dependencies.


    1. Fix your driver class name as com.mysql.jdbc.Driver.
    2. Fix your username and password property as

      "connection.username" for database user
      "connection.password" for database user password
      
    3. Create mysql database. See this.

    4. For SSL warning, modify your connection.url to include use ssl false. For example, jdbc:mysql://localhost:3306/?autoReconnect=true&useSSL=false

    5. Modify your mysql dialect to org.hibernate.dialect.MySQLDialect

    6. Use create-drop instead of update however do not use this option in production. You should create schema yourself and not do it via hibernate.

提交回复
热议问题