16 Şubat 2023 Perşembe

SpringBoot DataSource application.properties MySQL Ayarları

Örnek
Şöyle yaparız.
spring.datasource.url=jdbc:mysql://localhost/mydb
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
Örnek
Şöyle yaparız.
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/web_customer_tracker
spring.datasource.username=springstudent
spring.datasource.password=springstudent
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url-base=jdbc:mysql://localhost:3306
spring.datasource.url=${spring.datasource.url-base}/cloud_school
spring.datasource.username=root
spring.datasource.password=root
Örnek
Şöyle yaparız
# application.properties
spring.datasource.url=jdbc:mysql://localhost/appdb
spring.datasource.username=user
spring.datasource.password=password
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

# application.yml
spring:
  datasource:
    url: jdbc:mysql://localhost/mydb
    username: user
    password: password
    driver-class-name: com.mysql.jdbc.Driver


Hiç yorum yok:

Yorum Gönder