database - ASP.NET 核心 + Heroku。数据库迁移
问题描述
我想使用 ASP.NET Core 中的迁移来更新 Heroku 上的数据库。我使用了正确的连接字符串(DATABASE_URL),但是当我
update-database
从包管理器控制台运行命令时,我收到消息
Format of the initialization string does not conform to specification starting at index 0.
我将在此处保留连接字符串格式:
postgres://odb...:5670...@ec2-54-243-54-6.compute-1.amazonaws.com:5432/2d...
解决方案
我以为DATABASE_URL
格式很好,其实不然,你需要使用Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;
, PLUS 最后我传递了两个额外的参数:Sslmode=Require;
和Trust Server Certificate=true
.
推荐阅读
- reactjs - React Hook useMemo 被传递了一个不是数组文字的依赖列表
- postgresql - 如何在tableau中的同一工作表上从多个表中绘制图形
- javascript - 如何在 WordPress 中填写联系表格 7 中所需的“文件”字段
- python - Python FLASK 返回键盘中断
- python - Tensorflow 1.13.1、CUDA 10.0 和 RTX 3070 的 Blas GEMM 启动失败
- java - Android Studio 中的顶部导航栏标题替换
- python - 如何在pygame中使用不同的变量更改变量
- git - git 命令检索最新的 git 提交消息
- c++ - 将 << 运算符与 stringsteam 一起使用和编写成员函数之间的区别
- c# - Xamarin Android pop async 未正确关闭实例