postgresql 如何从 mac 连接到 aws Redshift db

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24432652/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 01:31:01  来源:igfitidea点击:

How to connect to aws Redshift db from mac

macospostgresqlamazon-web-servicesamazon-redshiftsequelpro

提问by johncorser

I am using a mac and I typically use Sequel Pro to interact with sql databases. Usually I use mysql, but I understand redshift uses Postgres.

我使用的是 mac,我通常使用 Sequel Pro 与 sql 数据库进行交互。通常我使用 mysql,但我了解 redshift 使用 Postgres。

When I try to connect to my Redshift db, should I use the IP, or the "endpoint"?

当我尝试连接到我的 Redshift 数据库时,我应该使用 IP 还是“端点”?

Also when I try to connect, I get this error from Sequel Pro.

此外,当我尝试连接时,我从 Sequel Pro 收到此错误。

Unable to connect to host {{my_db_host}}, or the request timed out.

Be sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds).

MySQL said: Can't connect to MySQL server on '{{my_db_host}}' (4)

Can anyone offer advice on how to get connected?

任何人都可以提供有关如何建立联系的建议吗?

Thanks

谢谢

回答by Dan Ciborowski - MSFT

You should be using the Redshift Endpoint, if you have your security group settings configured correctly. You might want to set your group to 0.0.0.0/0 during testing(this opens up your cluster to the entire internet, and you can lock it down later once it works)

如果您的安全组设置配置正确,您应该使用 Redshift Endpoint。您可能希望在测试期间将您的组设置为 0.0.0.0/0(这会向整个 Internet 开放您的集群,并且您可以稍后在它工作后将其锁定)

You also need to make sure you have the correct ODBC/JDBC driver. I recommend either Netbeans(comes with connection driver), SQL Workbench, or Aginity Redshift. Default port is 5439.

您还需要确保您拥有正确的 ODBC/JDBC 驱动程序。我推荐 Netbeans(带有连接驱动程序)、SQL Workbench 或 Aginity Redshift。默认端口为 5439。

I thikn you are using the wrong driver(a mysql driver not psql driver), becaues your error says MySQL server.

我认为您使用了错误的驱动程序(mysql 驱动程序而不是 psql 驱动程序),因为您的错误是 MySQL 服务器。

http://docs.aws.amazon.com/redshift/latest/gsg/rs-gsg-prereq.html

http://docs.aws.amazon.com/redshift/latest/gsg/rs-gsg-prereq.html

For mac, I believe you could also try and use the a terminal PSQL client. Something like...

对于 mac,我相信您也可以尝试使用终端 PSQL 客户端。就像是...

psql -H endpoint.aws.com -p 5439 -U username --password