SpringBoot配置文件application.properties数据库配置

 
 
# DB Configuration
#指定数据库驱动
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#数据库jdbc连接url地址,serverTimezone设置数据库时区东八区
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/user
#数据库账号
spring.datasource.username=root
spring.datasource.password=root

# JPAConfiguration
spring.jpa.database=MySQL
#spring data jpa 打印sql
spring.jpa.show-sql=true
spring.jpa.generate-ddl=true
 

SpringBoot配置文件中的数据库配置

将show-sql改成true,log才会输出sql语句,便于调试。
generate-ddl: false表示sping启动的时候不自动生成增删改查接口(因为我们自己会写增删改查接口),

猜你喜欢

转载自www.cnblogs.com/xxblogs/p/11801661.html
今日推荐