首页 > 解决方案 > 将 heroku 与 Google Cloud MySql 连接起来

问题描述

我正在为 Heroku 上的 react 本机移动应用程序部署 spring-boot 后端。除了在 Heroku 中使用 PostgreSQL,我可以知道一种将 Heroku 与我在 Google Cloud Platform(GCP)中创建的 MySQL 数据库连接的方法吗?

我尝试使用该application.properties文件将它与 GCP 连接,但它在 Heroku 中出现错误。

以下代码用于 application.properties 文件

spring.jpa.hibernate.ddl-auto=update

spring.jpa.show-sql=true

spring.datasource.url=jdbc:mysql://##.##.###.###/M######?useSSL=false

spring.datasource.username=###########

spring.datasource.password=#########

标签: mysqlspring-bootherokugoogle-cloud-platform

解决方案


推荐阅读