# 相關的spring boot application properties設定 ```=\ spring.profiles.active=prod ``` 根據active設定的參數,會決定專案讀哪個properties檔  命名格式:application-{profile}.properties ___ ```=\ server.port=8080 ``` 設定port ___ ```=\ server.servlet.context-path=/camiol-api ``` 設定專案的網址名稱 ___ ```=\ spring.main.banner-mode=off ``` 設定spring boot 啟動的圖樣是否顯示 ___ ```=\ spring.datasource.url=jdbc:mysql://127.0.0.1:3306/mydb?useUnicode=yes&characterEncoding=UTF-8 spring.datasource.username=root spring.datasource.password=1qaz@WSX spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver ``` 設定DB連線資訊 ___ ```=\ spring.jpa.database-platform=org.hibernate.dialect.MySQL8Dialect ``` 設定使用的資料庫平台 ___ ```=\ spring.jpa.hibernate.ddl-auto=update ``` 設定服務起來時要用何種方式執行ddl指令, 有create, update, create-drop 等形式。 create: 啟動時建立Table, 下次啟動會覆蓋上次的, 故會造成資料遺失 update: 若無Table則啟動時建立, 若有則視有無變更自動Update create-drop:啟動時建立Table, 當次Session關閉則刪除 ___ ```=\ spring.jpa.show-sql=true ``` 設定是否顯示SQL ___ ###### tags: `Spring boot`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up