連接數(shù)據(jù)庫報錯。該怎么處理?
按照課程配置。
<dependency>
? <groupId>org.springframework.boot</groupId>
? <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
? ? ?<dependency>
? ? ? ? ?<groupId>org.springframework.boot</groupId>
? ? ? ? ?<artifactId>spring-boot-starter-jdbc</artifactId>
? ? ?</dependency>
<dependency>
? <groupId>mysql</groupId>
? <artifactId>mysql-connector-java</artifactId>
</dependency>
spring:
profiles:
active: dev
datasource:
? ? ?driver-class-name: com.mysql.jdbc.Driver
? ? ?url: jdbc:mysql://localhost:3306/dbgirl
? ? ?username: ****
? ? ?password: ***
jpa:
? ? ?hibernate:
? ? ?ddl-auto: create
? ? ?show-sql: true
運行報錯。
Description:
Cannot determine embedded database driver class for database type NONE
Action:
If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
2017-06-12
加上mysql依賴,
如果用hibernate還有hibernate的依賴
2017-06-18
dependency沒有問題。
可能是配置的縮進格式問題。 我用git下載了課程的代碼。把配置文件重新拷貝了下就可以了。
2017-06-12
你還要檢察數(shù)據(jù)庫是否存在等一些問題