Skip to content

Instantly share code, notes, and snippets.

@SimonJoz
Last active August 17, 2021 18:55
Show Gist options
  • Select an option

  • Save SimonJoz/6106692306410c7da707e6fc48aed319 to your computer and use it in GitHub Desktop.

Select an option

Save SimonJoz/6106692306410c7da707e6fc48aed319 to your computer and use it in GitHub Desktop.
Example MySQL database configuration in Spring Boot.
spring:
datasource:
url: ${MYSQL_DB_URL:jdbc:mysql://localhost:3306/}
password: ${MYSQL_DB_PASS:pass}
username: ${MYSQL_DB_USERNAME:root}
driver-class-name: com.mysql.cj.jdbc.Driver
initialization-mode: always
schema: classpath:sql/schema-dev.sql
data: classpath:sql/dev-initializer.sql
hikari:
maximum-pool-size: 30
connection-timeout: 20000
leak-detection-threshold: 25000
jpa:
properties:
hibernate:
generate_statistics: true
hibernate:
ddl-auto: none
show-sql: true
open-in-view: false
database-platform: org.hibernate.dialect.MySQL8Dialect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment