未能配置DataSource:未指定'url‘属性,并且无法配置任何嵌入的数据源。 |
您所在的位置:网站首页 › 未指定url怎么办 › 未能配置DataSource:未指定'url‘属性,并且无法配置任何嵌入的数据源。 |
我是java新手。创建了一个示例spring项目,并尝试连接到本地mysql数据库。下面是我的pom.xml 4.0.0 org.springframework.boot spring-boot-starter-parent 2.4.2 com.org dbtest 0.0.1-SNAPSHOT dbtest Demo project for Spring Boot 1.8 org.springframework.boot spring-boot-starter-data-jpa org.springframework.boot spring-boot-starter-web mysql mysql-connector-java runtime org.springframework.boot spring-boot-starter-test test org.springframework.boot spring-boot-maven-pluginApplication.properties文件如下: jdbc.driverClassName = com.mysql.jdbc.Driver jdbc.url = jdbc:mysql://localhost:3306/HR jdbc.username = HR jdbc.password = admin hibernate.dialect = org.hibernate.dialect.MySQL8Dialect.class server.port = 3080我仍然无法连接到mysql数据库。但是,我可以从mysql工作台访问数据库。 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |