我有一个使用Vagrant的Ubuntu虚拟机,我用vagrant up
和vagrant ssh
设置并运行它,我创建了数据库psql -d dbname -f somesqlqueries.sql
。你知道吗
每当我试图通过python通过执行conn = psycopg2.connect("dbname=dbname")
连接到此数据库时,都会出现以下错误:
psycopg2.OperationalError: could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
我改变了这个问题的解决方案postgresql.conf文件但仍然会发生相同的错误。你知道吗
还尝试关闭防火墙并运行sudo ufw allow 5432/tcp
,错误仍然存在。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐