我试图使用sslmode='required‘param使用psycopg2连接到postgres数据库;但是,我得到了以下错误
psycopg2.OperationalError: sslmode value "require" invalid when SSL support is not compiled in
这是关于我的系统的几个细节
Mac El Capitan
Python 2.7
通过pip安装psycopg2
通过自制安装python
以下是我试图解决这个问题的方法
brew uninstall python
which
从这个
给定URI:
jdbc:redshift://sample.redshift.openbridge.io:5439/sample_database?ssl=true&sslfactory=com.amazon.redshift.ssl.NonValidatingFactory
此外,我只需要Username和Password连接到AWS上的红移服务器。
如果我在Python中使用psycopg2,我将需要以下字段来建立到数据库的连接:
dbname
host
port
user
password
例如。
import psycopg2
con
我正在尝试通过SSL连接到AWS Redshift服务器。我使用python中的psycopg2库来建立连接,并在连接行中使用sslmode='require'作为参数。不幸的是,我得到了这个错误:
sslmode value "require" invalid when SSL support is not compiled in
我读过许多其他类似的PostgreSQL案例,提到PostgeSQL版本存在这个问题,但我没有找到任何使用Psycopg2的Redshift解决方案。是否需要为Redshift安装特定的SSL证书?如果是,我该如何使用Psycopg
我试图在AWS中运行python代码,在运行测试时,我得到了aws的异常。
我不明白这种例外是什么类型的。这是我的第一次。
{
"errorMessage": "The 'psycopg2>=2.5' distribution was not found and is required by the application",
"errorType": "DistributionNotFound",
"stackTrace": [
[
"/var/ta
当我运行以下命令时:
import psycopg2
#...
cur.execute("DROP TABLE IF EXISTS Song CASCADE")
cur.execute("CREATE TABLE Song "
"(songId INT PRIMARY KEY, "
"data jsonb, "
"lastUpdate TIMESTAMP)")
#...
我得到了
Error type "jsonb" does not exist`
psycopg2
我正在尝试使用psycopg2连接到postgres数据库:
import psycopg2
try:
conn = psycopg2.connect("dbname='puppetdb' user='puppetdb' host='172.17.0.1' port='5432' password='puppetdb'")
except Exception, e:
print "I am unable to connect to the database"
我正在使用Docker和psycopg2连接到我的docker-组合中的另一个数据库服务。但是,我在psycopg2中得到了一个导入错误:
Python 3.8.2 (default, Feb 29 2020, 17:03:31)
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
Traceback (most recent call las