Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何连接AWS PostgreSQL数据库中的pgAdmin3?_Postgresql_Amazon Web Services_Ssh_Amazon Ec2_Pgadmin - Fatal编程技术网

如何连接AWS PostgreSQL数据库中的pgAdmin3?

如何连接AWS PostgreSQL数据库中的pgAdmin3?,postgresql,amazon-web-services,ssh,amazon-ec2,pgadmin,Postgresql,Amazon Web Services,Ssh,Amazon Ec2,Pgadmin,我无法通过本地计算机连接AWS postgres remote 我肯定没有连接到AWS服务器中的postgres remote 我已经开始关注另一个话题了,但我仍然不明白为什么不连接到任何地方 在我的远程服务器中,我遵循以下3个步骤: 1) 我将远程数据库的端口更改为5434 2) 在postgresql.conf文件中,我将“*”设置为listen\u addresses标志 在pg_hba.conf文件中,我设置宿主所有0.0.0.0/0 md5属性 3) 我重新启动远程服务器的postg

我无法通过本地计算机连接AWS postgres remote

我肯定没有连接到AWS服务器中的postgres remote

我已经开始关注另一个话题了,但我仍然不明白为什么不连接到任何地方

在我的远程服务器中,我遵循以下3个步骤:

1) 我将远程数据库的端口更改为
5434

2) 在
postgresql.conf
文件中,我将“*”设置为
listen\u addresses
标志

pg_hba.conf
文件中,我设置
宿主所有0.0.0.0/0 md5
属性

3) 我重新启动远程服务器的postgres服务

PgAdmin3错误输出:


05:17:44 PM:错误:SSH错误:启动SSH会话时出错,错误代码为-8[无法交换加密密钥]

我尚未成功访问postgres remote到AWS RDBMS。我遵循以下指示:

屏幕截图:

我关注以下所有主题:

我将pgAdmin3配置为访问,如下所示:

  • MY_IP_此处
    I使用AWS ipv4设置
  • 我的用户\u此处
    我使用我的数据库用户设置

然后我尝试用HTTP隧道连接我的远程数据库

而我失败了

有时此弹出错误出现在pgAdmin3中:

ASSERT INFO:
/usr/include/wx-3.0/wx/strvararg.h(456): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type

BACKTRACE:
[1] wxMBConvUTF32LE::~wxMBConvUTF32LE()
[2] char* std::string::_S_construct<char*>(char*, char*, std::allocator<char> const&, std::forward_iterator_tag)
[3] char* std::string::_S_construct<char*>(char*, char*, std::allocator<char> const&, std::forward_iterator_tag)
[4] char* std::string::_S_construct<char*>(char*, char*, std::allocator<char> const&, std::forward_iterator_tag)
[5] wxListEvent::~wxListEvent()
[6] wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const
[7] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[8] wxEvtHandler::SearchDynamicEventTable(wxEvent&)
[9] wxEvtHandler::TryHereOnly(wxEvent&)
[10] wxEvtHandler::DoTryChain(wxEvent&)
[11] wxEvtHandler::ProcessEvent(wxEvent&)
[12] wxWindowBase::TryAfter(wxEvent&)
[13] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[14] wxToolBarBase::OnLeftClick(int, bool)
[15] g_signal_emit_valist
[16] g_signal_emit_by_name
[17] g_signal_emit_valist
[18] g_signal_emit
[19] g_closure_invoke
[20] g_signal_emit_valist
[21] g_signal_emit
[22] g_closure_invoke
[23] g_signal_emit_valist
[24] g_signal_emit
[25] gtk_propagate_event
[26] gtk_main_do_event
[27] g_main_context_dispatch
[28] g_main_loop_run
[29] gtk_main
[30] wxGUIEventLoop::DoRun()
[31] wxEventLoopBase::Run()
[32] wxAppConsoleBase::MainLoop()
[33] wxEntry(int&, wchar_t**)
[34] __libc_start_main
断言信息:
/usr/include/wx-3.0/wx/strvarg.h(456):断言“(argtype&(wxFormatStringSpecifier::value))==argtype”在wxArgNormalizer()中失败:格式说明符与参数类型不匹配
回溯:
[1] wxMBConvUTF32LE::~wxMBConvUTF32LE()
[2] char*std::string::_S_构造(char*,char*,std::allocator const&,std::forward\u iterator\u标记)
[3] char*std::string::_S_构造(char*,char*,std::allocator const&,std::forward\u iterator\u标记)
[4] char*std::string::_S_构造(char*,char*,std::allocator const&,std::forward\u iterator\u标记)
[5] wxListEvent::~wxListEvent()
[6] wxAppConsoleBase::CallEventHandler(wxEvtHandler*,wxEventFunctor&,wxEvent&)常量
[7] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase常量&,wxEvtHandler*,wxEvent&)
[8] wxEvtHandler::SearchDynamicEventTable(wxEvent&)
[9] wxEvtHandler::TryHereOnly(wxEvent&)
[10] wxEvtHandler::DoTryChain(wxEvent&)
[11] wxEvtHandler::ProcessEvent(wxEvent&)
[12] wxWindowBase::TryAfter(wxEvent&)
[13] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[14] wxToolBarBase::OnLeftClick(int,bool)
[15] g_信号_发射_有效
[16] g_信号按名称发出
[17] g_信号_发射_有效
[18] g_信号_发射
[19] g_闭包\u调用
[20] g_信号_发射_有效
[21]g_信号_发射
[22]g_关闭_调用
[23]g_信号发出有效
[24]g_信号_发射
[25]gtk_传播_事件
[26]gtk_主要_do_活动
[27]g_main_context_调度
[28]g_主回路运行
[29]gtk_主管道
[30]wxGUIEventLoop::DoRun()
[31]wxEventLoopBase::Run()
[32]wxAppConsoleBase::MainLoop()
[33]wxEntry(内部和外部)
[34]\u libc\u start\u main

我也有同样的问题,我找到了一个解决方案(针对Linux)

使用以下命令行:

sudo ssh -N -L 1234:yourrdsendpointname.us-east-1.rds.amazonaws.com:5432 ec2-user@56.78.123.45 -i yourkeyfile.pem
在本例中,1234是本地端口(在本地主机中可用),yourrdsendpointname.us-east-1.rds.amazonaws.com是aws中rds数据库的端点,ec2 user是ec2实例的默认用户,该实例有权连接到rds数据库,56.78.123.45是ec2实例的公共ip,yourkeyfile.pem是访问ec2实例的密钥

当您运行此命令时,您可以使用pgAdmin或psql命令访问本地主机和端口1234中的数据库(请注意,此命令应在终端中运行,以保持隧道打开)

你可以到这里来进一步解释


我也有同样的问题,我找到了一个解决方案(针对Linux)

使用以下命令行:

sudo ssh -N -L 1234:yourrdsendpointname.us-east-1.rds.amazonaws.com:5432 ec2-user@56.78.123.45 -i yourkeyfile.pem
在本例中,1234是本地端口(在本地主机中可用),yourrdsendpointname.us-east-1.rds.amazonaws.com是aws中rds数据库的端点,ec2 user是ec2实例的默认用户,该实例有权连接到rds数据库,56.78.123.45是ec2实例的公共ip,yourkeyfile.pem是访问ec2实例的密钥

当您运行此命令时,您可以使用pgAdmin或psql命令访问本地主机和端口1234中的数据库(请注意,此命令应在终端中运行,以保持隧道打开)

你可以到这里来进一步解释


@Nielson我尝试在linux控制台上使用SSH隧道进行连接

5433
是我机器的postgres本地端口

$sudo lsof-i:5433

命令PID用户FD类型设备大小/关闭节点名称
pgadmin3 1329 paneladm 15u IPv4 1534908 0t0 TCP debian:56894->ec2-[MY_IP].[ZONE].compute.amazonaws.com:5433(同步发送)

航站楼下面是空的

在PgAdmin3中也没有连接

我也不知道如何与RDS建立外部连接,因为默认组已经允许外部连接

参考资料:


@Nielson我尝试在linux控制台上使用SSH隧道进行连接

5433
是我机器的postgres本地端口

$sudo lsof-i:5433

命令PID用户FD类型设备大小/关闭节点名称
pgadmin3 1329 paneladm 15u IPv4 1534908 0t0 TCP debian:56894->ec2-[MY_IP].[ZONE].compute.amazonaws.com:5433(同步发送)

航站楼下面是空的

在PgAdmin3中也没有连接

我也不知道如何与RDS建立外部连接,因为默认组已经允许外部连接

参考资料:


我也发布了有关RDS实例错误的更多详细信息。@F