From afb87d0c12e2b80b688e62dd240478b4342d6411 Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Sun, 22 Dec 2024 12:15:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0mysql=E4=BD=9C?= =?UTF-8?q?=E4=B8=BA=E5=90=8E=E7=AB=AF=E6=95=B0=E6=8D=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/dataSources.xml | 30 ++++++++++++++++++++++++++++++ src/main/resources/application.yml | 25 +++++++++++++++++++++---- 2 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 .idea/dataSources.xml diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml new file mode 100644 index 0000000..fa88218 --- /dev/null +++ b/.idea/dataSources.xml @@ -0,0 +1,30 @@ + + + + + mysql.8 + true + com.mysql.cj.jdbc.Driver + jdbc:mysql://192.168.31.127:3780 + + + + + + $ProjectFileDir$ + + + mysql.8 + true + com.mysql.cj.jdbc.Driver + jdbc:mysql://192.168.31.127:3780/bookstore + + + + + + + $ProjectFileDir$ + + + \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index a6bdf3b..293d4cb 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -3,12 +3,29 @@ server: spring: application: name: bookstore + jpa: + hibernate: + ddl-auto: update + show-sql: true + +--- +spring: + config: + activate: + on-profile: h2 datasource: url: jdbc:h2:file:./database;DB_CLOSE_ON_EXIT=FALSE driver-class-name: org.h2.Driver username: lanyuanxiaoyao password: lanyuanxiaoyao - jpa: - hibernate: - ddl-auto: update - show-sql: true \ No newline at end of file + +--- +spring: + config: + activate: + on-profile: mysql-local + datasource: + url: jdbc:mysql://192.168.31.127:3780/bookstore + driver-class-name: com.mysql.cj.jdbc.Driver + username: bookstore + password: EzSn+RZ*x2&fHFh9kC+H