Spring Boot启动失败:DataSource配置错误及解决方法
2023-07-14 10:27:52.272[0;39m [31mERROR[0;39m [35m47640[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mo.s.b.d.LoggingFailureAnalysisReporter [0;39m [2m:[0;39m \nAPPLICATION FAILED TO START\n\n\nDescription:\n\nFailed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.\n\nReason: Failed to determine a suitable driver class\n\n\nAction:\n\nConsider the following:\n If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.\n If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).\n\n\n If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).\n\n错误。为什么出现,该怎么解决,请用浅显易懂的话语详细说明。我使用的mysql数据库,如何添加该依赖。\n\t\t\n<dependency>\n <groupId>mysql</groupId>\n <artifactId>mysql-connector-java</artifactId>\n</dependency>\n<dependency>\n <groupId>org.mybatis.spring.boot</groupId>\n <artifactId>mybatis-spring-boot-starter</artifactId>\n <version>2.0.1</version>\n</dependency>\n<dependency>\n <groupId>org.springframework.boot</groupId>\n <artifactId>spring-boot-starter-data-jpa</artifactId>\n</dependency>\n\n\n请确保以上依赖已正确添加到你的项目的pom.xml文件中。
原文地址: https://www.cveoy.top/t/topic/pL9M 著作权归作者所有。请勿转载和采集!