配置application.yml踩的坑
spring: application: name: user-center datasource: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/scheduling username: root password: 123456 server: port: 8080 mybatis-plus: configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl map-underscore-to-camel-case: true
更改后
spring: application: name: user-center # DataSource Config datasource: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/usercenter username: root password: 123456 server: port: 8080 mybatis-plus: configuration: map-underscore-to-camel-case: false
配置的时候,错将datasource放在了application的下一级,所以运行时,检测不出datasource下配置的所有东西。(我找了很长时间的报错,没想到就出现在这个很小的细节上,警钟长鸣)
本文作者:万事胜意k
本文链接:https://www.cnblogs.com/ysk0904/p/17653767.html
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步