美文网首页
SpringBoot +JPA里面的坑

SpringBoot +JPA里面的坑

作者: ChineseBoy | 来源:发表于2017-06-12 10:42 被阅读46次

    1.先看代码:

    spring:
      datasource:
        driver-class-name: com.mysql.jdbc.Driver
        url: jdbc:mysql://127.0.0.1:3306/db_user
        username: root
        password: root
      jpa:
        hibernate:
          ddl-auto: create #ddl-auto:设为create表示每次都重新建表
        show-sql: true
    

    这个配置文件一个要在最前面加上spring:,不然的话会一直报错,说你没有编写db配置文件,
    报错信息如下:

    Description:
    Cannot determine embedded database driver class for database type NONE
    Action:
    If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
    

    相关文章

      网友评论

          本文标题:SpringBoot +JPA里面的坑

          本文链接:https://www.haomeiwen.com/subject/ahqlqxtx.html