试图将Python与SSH隧道连接起来
我正在尝试通过SSHTUNNEL和PSYCOPG2将脚本连接到PostgreSQL数据库。我可以通过DBEAVER访问我的凭据。因此,基本上我有一个:
ssh paramateres与以下相似的地方
: IP:'SomeProxy.something.io'
用户名:'user1'
私钥:ID_RSA文件的路径
密码:'password1'
这是我的代码:
try:
print('Connecting to the postgre database...')
with SSHTunnelForwarder(
"someproxy.something.io",
ssh_username = "User1",
ssh_private_key = "C:/~ /.ssh/User1_id_rsa",
ssh_private_key_password = "Password1",
remote_bind_adress = ("mydatabase-postgres.something.io", 5432)
) as server:
server.start()
我遇到了此错误:
ValueError: Unknown arguments: {'remote_bind_adress': ('mydatabase-postgres.something.io', 5432)}
I'm trying to connect my script to a PostgreSQL database via sshtunnel and psycopg2. I can access the DB with my credentials through DBeaver. So, basically I have this:
Where the SSH paramateres are similar to this:
Host/IP: 'someproxy.something.io'
User Name: 'User1'
Private key: Path to an id_rsa file
Passphrase: 'Password1'
This is my code:
try:
print('Connecting to the postgre database...')
with SSHTunnelForwarder(
"someproxy.something.io",
ssh_username = "User1",
ssh_private_key = "C:/~ /.ssh/User1_id_rsa",
ssh_private_key_password = "Password1",
remote_bind_adress = ("mydatabase-postgres.something.io", 5432)
) as server:
server.start()
And I'm getting this error:
ValueError: Unknown arguments: {'remote_bind_adress': ('mydatabase-postgres.something.io', 5432)}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您在参数名称中有一个错别字:
remote_bind_adress->远程_BIND_ADDRESS
。You have a typo in the parameter name:
remote_bind_adress -> remote_bind_address
.