spring: datasource: driver-class-name: com.mysql.jdbc.Driver url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8 username: root password: root jpa: hibernate: ddl-auto: update show-sql: true
SpringBoot版本2.0.2,在.yml文件中,配置datasource。项目启动不报错,控制台也没有数据库相关信息。也不能自动建表。
这是启动类:
@SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }
HansonQ