mysql - 将 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=#########
解决方案
推荐阅读
- swift - 在 xcode (PathKit) 中获取项目目录的路径
- angular - 嵌套控件的修补值 3 级深
- ruby-on-rails - 尝试在 Rails 测试中运行 ruby
- c# - 在 C# 中,使用 SocketAsyncEventArgs 缓冲区处理部分接收到的消息的最佳方法是什么
- android - TCP 客户端与 ESP8266-01 上的服务器通信
- solr - Solr - 根据条件执行不同的查询
- sql-server - 将几何解析为纬度,经度失败
- javascript - React-Native:使用 AsyncStorage 获取值并在应用程序/屏幕的“开始”处更新状态的正确方法是什么?
- javascript - 获取删除请求无法正常工作
- angular - 角度路线动画动态变化