Springboot项目启动报错Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded d

怼烎@ 2023-09-24 13:36 21阅读 0赞
  1. ***************************
  2. APPLICATION FAILED TO START
  3. ***************************
  4. Description:
  5. Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
  6. Reason: Failed to determine a suitable driver class
  7. Action:
  8. Consider the following:
  9. If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
  10. If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
  11. Process finished with exit code 1

解决方法:在url项目后加上如下配置信息:

useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8

  1. url: jdbc:mysql://127.0.0.1:3306/springbootr0361?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8

还不行的话有时候idea编译器没有编译项目,需要手动build下或maven-package下就基本OK了

59b8d85aebde4fca9121a769e32b3d87.png

发表评论

表情:
评论列表 (有 0 条评论,21人围观)

还没有评论,来说两句吧...

相关阅读