postgresql - 我无法在 Heroku 上使用 Strapi 连接到 Postgres DB
问题描述
如此处所述,尝试使用 Postgres 在 Heroku 上部署 Strapi
https://strapi.io/documentation/v3.x/deployment/heroku.html
但我得到这个错误
error: no pg_hba.conf entry for host "84.212.51.43", user "ssqqeaz***", database "d6gtu***", SSL off
我使用 Heroku Postgres 插件。
我的数据库配置:
module.exports = ({ env }) => ({
defaultConnection: 'default',
connections: {
default: {
connector: 'bookshelf',
settings: {
client: 'postgres',
host: env('DATABASE_HOST', '127.0.0.1'),
port: env.int('DATABASE_PORT', 27017),
database: env('DATABASE_NAME', 'strapi'),
username: env('DATABASE_USERNAME', ''),
password: env('DATABASE_PASSWORD', ''),
},
options: {
ssl: true
},
},
},
});
为什么?请帮忙!
解决方案
试着ssl : true
变成ssl : false
推荐阅读
- memory - 确定给定地址是 4k 还是 8k 对齐
- javascript - 如何使“使用 bitcoinjs-lib 发送交易”工作?
- python - 根据Python中的多个条件将多个数据帧中的一列合并到另一个数据帧
- javascript - JavaScript 中 curl 请求的等价物是什么?
- sql - 具有多列的 Sql Between 子句
- assembly - 在 MIPS 中通过移位和加法进行乘法,无需乘法
- java - 任何人都可以解释构造函数、继承和运行时多态性是如何工作的吗?还要解释以下输出背后的逻辑
- c++ - 如果已经创建了一个 mongocxx::instance 对象,则无法创建该对象
- postgresql - Citus:将现有数据库作为 citus 的工作节点
- sql - 用于转换编号的 SQL 查询。行数到没有。oracle 中的列