Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
If it was only Spring Boot, it worked, but when I put mybatis in dependencies, an error occurred at startup. It was because there was no data source setting.
It was solved by specifying the connection information to the database in application.properties or application.yml. If you generate a project with https://start.spring.io/, src / main / resources / application.properties will be generated, but you can also use application.yml.
In the case of MySQL, it looks like this.
application.yml
spring:
datasource:
url: jdbc:mysql://localhost:3306/mysql
username: devusr
password: devpass
driver-class-name: com.mysql.cj.jdbc.Driver
Recommended Posts