admin管理员组文章数量:1277901
I'm trying to configure PyCharm's Data Source tool to use a locally running postgres database (not in a container) and it simply fails with the (not very helpful) message "[08001] The connection attempt failed."
I can connect to it in the shell with the command psql -hlocalhost -p5432 -Umac1 lib1
. Also the code I wrote in PyCharm has no problem accessing it, with psycopg.connect("dbname=lib1")
.
I added the data source in the "Data Sources and Drivers" dialog and edited the information accordingly. For "Authentication" I chose "User & Password", set "User" to "mac1", and "Password" to what I set in psql with "ALTER USER mac1 WITH PASSWORD". The URL I get is jdbc:postgresql://localhost:5432/lib1
, which seems correct to me. But PyCharm fails to connect. I also tried turning on/off SSL but that didn't help.
The postgresql server version I'm using is 16.3, and PyCharm is using postgresql driver ver 42.7.3.
本文标签: pythonPyCharm cannot connect to local postgresql databaseStack Overflow
版权声明:本文标题:python - PyCharm cannot connect to local postgresql database - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741283343a2370132.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论