mybatis No active profile set, falling back to 1 default profile: "default"
时间: 2023-10-31 09:58:04 浏览: 169
根据提供的引用内容,问题是关于MyBatis和Spring Boot启动错误的。根据引用,可以看出Spring Boot应用启动时出现了"No active profile set, falling back to default profiles: default"的错误信息。解决这个问题的方法在引用中提到了创建一个application.yml配置文件,并设置"spring.profiles.active"属性为"dev"。然后,根据引用,需要创建一个名为"application-dev.yml"的文件,并在其中配置相应的数据库和MyBatis的信息。
综上所述,为了解决该错误,你可以按照以下步骤进行操作:
1. 创建一个名为"application.yml"的配置文件。
2. 在该文件中添加以下内容:
```
spring:
profiles:
active: dev
```
3. 创建一个名为"application-dev.yml"的配置文件,并将以下内容添加到该文件中:
```
server:
port: 8080
spring:
datasource:
username: root
password: 123456
url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC
driver-class-name: com.mysql.cj.jdbc.Driver
mybatis:
mapper-locations: classpath:mapping/*Mapper.xml
type-aliases-package: com.entity
```
4. 保存并重新启动应用程序。
这样做将解决"MyBatis No active profile set, falling back to default profile: 'default'"的错误,并且应用程序将使用"dev"配置文件来启动。
阅读全文
相关推荐


















