可是数据库配置弄好了
报错显示如下
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-02-16 20:38:59.746 ERROR 11140 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
APPLICATION FAILED TO START
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).
Process finished with exit code 0
无法配置DataSource:未指定’url’属性,也无法配置嵌入数据源
可能是.properties文件中datasource的配置出现错误,例如:地址值,数据库驱动,用户名,密码。
驱动不对吧
建议你把配置文件截图发出来,上面的聊天记录里的配置我初略看了下,是错的,正确的应该是下面这样
spring:
datasource:
url: jdbc:mysql://localhost/db_spring_security?useSSL=false&charracterEncoding=utf-8&useUnicode=true&serverTimezone=GMT%2b8
username: root
password: 123456
driver-class-name: com.mysql.jdbc.Driver
DataSource里面没有设置url参数,检查有没有写错。