java - 如何将我的 SpringBoot 应用程序与 MySQL 数据库连接?
问题描述
我尝试在 application.properties 中设置 URL,但出现此错误:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
原因:无法确定合适的驱动程序类
spring.datasource.url=jdbc:mysql://localhost:3306/springboot
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
spring.jpa.show-sql=false
spring.flyway.locations=classpath:db/mysql/migration
解决方案
推荐阅读
- flutter - Flutter:持久的底部导航栏在页面之间导航时重建所有页面
- postgresql - JSONB 忽略 Jackson 序列化包含
- spring-boot - HttpMessageNotReadableException 的模棱两可的 @ExceptionHandler 方法
- javascript - 通过javascript中的两个属性计算JSON
- google-apps-script - 简化 Google Apps 表中的 .setFormula 代码
- node.js - 无法在 WebStorm 中调试 Node.js Express 应用程序
- serverless - Serverless Deploy 仅在第一次工作,然后发生可恢复的错误 (ETIMEDOUT)
- c# - 如何为此处的 api c# 生成 Oauth1.0 的签名
- macos - MacOS 上的 GridDB 自动生成警告
- python - 如何使用 Python 的预训练模型开发投票集成?