Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/25.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
Linux 无法再连接到postgresql_Linux_Postgresql - Fatal编程技术网

Linux 无法再连接到postgresql

Linux 无法再连接到postgresql,linux,postgresql,Linux,Postgresql,我想在我的Linux(Ubuntu16.04)虚拟机中释放一些空间,所以我删除了以前版本的postgresql(我有9.4、9.5和10.5版),只保留10.5版 因此,我运行了命令sudo apt get purge postgresql-9.* 现在,我只有10.5版。问题是,我无法再使用PGAdmin连接到我的数据库,而且,所有连接到postgres DB的C程序也无法再连接 我试着在网上查找修改过的文件 pg_hba.conf和postgresql.conf允许从端口5432进行所有连接

我想在我的Linux(Ubuntu16.04)虚拟机中释放一些空间,所以我删除了以前版本的postgresql(我有9.4、9.5和10.5版),只保留10.5版

因此,我运行了命令
sudo apt get purge postgresql-9.*
现在,我只有10.5版。问题是,我无法再使用PGAdmin连接到我的数据库,而且,所有连接到postgres DB的C程序也无法再连接

我试着在网上查找修改过的文件
pg_hba.conf
postgresql.conf
允许从端口5432进行所有连接,甚至重新打开端口5432,仍然是空的

在命令行上,我可以使用以下命令连接到数据库:

sudo -i -u postgres
psql
....

它肯定在运行吗?您能看到它绑定到netstat-anp上的端口5432吗?如果您有多个postgresql实例,它是否被转移到其他端口?这个问题不属于StackOverflow。您可能正在寻找或?Stack Overflow是一个关于编程和开发问题的网站。这个问题似乎离题了,因为它与编程或开发无关。请参见帮助中心中的。也许或者会是一个更好的提问的地方。