欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Spring boot 使用mysql實(shí)例詳解

 更新時(shí)間:2017年04月19日 11:27:26   投稿:lqh  
這篇文章主要介紹了Spring boot 使用mysql實(shí)例詳解的相關(guān)資料,需要的朋友可以參考下

Spring boot 使用mysql實(shí)例詳解

開發(fā)階段用 H2即可,上線時(shí),通過(guò)以下配置切換到mysql,spring boot將使用這個(gè)配置覆蓋默認(rèn)的H2。

1.建立數(shù)據(jù)庫(kù):

mysql -u root
CREATE DATABASE springbootdb

2.pom.xml:

<dependency>
     <groupId>mysql</groupId>
     <artifactId>mysql-connector-java</artifactId>
   </dependency>

3.application.properties:

spring.datasource.url= jdbc:mysql://localhost:3306/springbootdb
spring.datasource.username=root
spring.datasource.password=
spring.jpa.hibernate.ddl-auto=create-drop//none, validate, update, create-drop

感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

相關(guān)文章

最新評(píng)論