![Postgresql 11:在 ubuntu 桌面上重启后无法连接到服务器](https://linux22.com/image/908747/Postgresql%2011%EF%BC%9A%E5%9C%A8%20ubuntu%20%E6%A1%8C%E9%9D%A2%E4%B8%8A%E9%87%8D%E5%90%AF%E5%90%8E%E6%97%A0%E6%B3%95%E8%BF%9E%E6%8E%A5%E5%88%B0%E6%9C%8D%E5%8A%A1%E5%99%A8.png)
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
当我新安装时,postgresql/var/run/postgresql/
目录包含 2 或 3 个文件,其中.s.PGSQL.5432
一个是其中之一,但不幸的是,重新启动系统后目录为空。并出现上述错误。
我尝试按照互联网上的很多教程操作,但无法修复。有人能帮我解决这个问题吗?
运行后输出$ journalctl -u postgresql
-- Logs begin at Sat 2019-02-02 10:28:02 IST, end at Fri 2019-02-22 15:57:46 IST
Feb 19 15:36:57 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 19 15:36:57 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 19 16:28:42 ewb systemd[1]: Stopped PostgreSQL RDBMS.
Feb 19 16:28:42 ewb systemd[1]: Stopping PostgreSQL RDBMS...
Feb 19 16:28:46 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 19 16:28:46 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 19 16:34:30 ewb systemd[1]: Stopped PostgreSQL RDBMS.
Feb 19 16:35:07 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 19 16:35:07 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 19 17:37:33 ewb systemd[1]: Stopped PostgreSQL RDBMS.
-- Reboot --
Feb 19 17:42:17 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 19 17:42:18 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 19 17:49:20 ewb systemd[1]: Stopped PostgreSQL RDBMS.
Feb 19 17:49:20 ewb systemd[1]: Stopping PostgreSQL RDBMS...
Feb 19 17:49:20 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 19 17:49:20 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 19 17:57:47 ewb systemd[1]: Stopped PostgreSQL RDBMS.
Feb 19 17:59:53 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 19 17:59:53 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 19 18:05:27 ewb systemd[1]: Stopped PostgreSQL RDBMS.
-- Reboot --
lines 1-23...skipping...
-- Logs begin at Sat 2019-02-02 10:28:02 IST, end at Fri 2019-02-22 15:57:46 IST. --
Feb 19 15:36:57 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 19 15:36:57 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 19 16:28:42 ewb systemd[1]: Stopped PostgreSQL RDBMS.
Feb 19 16:28:42 ewb systemd[1]: Stopping PostgreSQL RDBMS...
Feb 19 16:28:46 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 19 16:28:46 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 19 16:34:30 ewb systemd[1]: Stopped PostgreSQL RDBMS.
Feb 19 16:35:07 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 19 16:35:07 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 19 17:37:33 ewb systemd[1]: Stopped PostgreSQL RDBMS.
-- Reboot --
Feb 19 17:42:17 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 19 17:42:18 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 19 17:49:20 ewb systemd[1]: Stopped PostgreSQL RDBMS.
Feb 19 17:49:20 ewb systemd[1]: Stopping PostgreSQL RDBMS...
Feb 19 17:49:20 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 19 17:49:20 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 19 17:57:47 ewb systemd[1]: Stopped PostgreSQL RDBMS.
Feb 19 17:59:53 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 19 17:59:53 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 19 18:05:27 ewb systemd[1]: Stopped PostgreSQL RDBMS.
-- Reboot --
Feb 20 09:15:24 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 20 09:15:24 ewb systemd[1]: Started PostgreSQL RDBMS.
-- Reboot --
Feb 20 09:21:01 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 20 09:21:01 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 20 09:37:23 ewb systemd[1]: Stopped PostgreSQL RDBMS.
Feb 20 09:37:23 ewb systemd[1]: Stopping PostgreSQL RDBMS...
Feb 20 09:37:23 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 20 09:37:23 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 20 10:13:32 ewb systemd[1]: Stopped PostgreSQL RDBMS.
-- Reboot --
Feb 20 10:15:53 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 20 10:15:53 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 20 10:42:02 ewb systemd[1]: Stopped PostgreSQL RDBMS.
Feb 20 10:42:02 ewb systemd[1]: Stopping PostgreSQL RDBMS...
Feb 20 10:42:02 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 20 10:42:02 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 20 10:44:45 ewb systemd[1]: Stopped PostgreSQL RDBMS.
Feb 20 10:44:45 ewb systemd[1]: Stopping PostgreSQL RDBMS...
Feb 20 10:44:45 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 20 10:44:45 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 20 10:51:22 ewb systemd[1]: Stopped PostgreSQL RDBMS.
Feb 20 10:51:22 ewb systemd[1]: Stopping PostgreSQL RDBMS...
Feb 20 10:51:23 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 20 10:51:23 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 20 11:13:06 ewb systemd[1]: Stopped PostgreSQL RDBMS.
Feb 20 11:13:06 ewb systemd[1]: Stopping PostgreSQL RDBMS...
Feb 20 11:13:06 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 20 11:13:06 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 20 11:16:07 ewb systemd[1]: Stopped PostgreSQL RDBMS.
Feb 20 11:16:07 ewb systemd[1]: Stopping PostgreSQL RDBMS...
Feb 20 11:16:07 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 20 11:16:07 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 20 11:17:55 ewb systemd[1]: Stopped PostgreSQL RDBMS.
Feb 20 11:17:55 ewb systemd[1]: Stopping PostgreSQL RDBMS...
Feb 20 11:17:55 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 20 11:17:55 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 20 11:20:35 ewb systemd[1]: Reloading PostgreSQL RDBMS.
Feb 20 11:20:35 ewb systemd[1]: Reloaded PostgreSQL RDBMS.
Feb 20 11:21:08 ewb systemd[1]: Reloading PostgreSQL RDBMS.
Feb 20 11:21:08 ewb systemd[1]: Reloaded PostgreSQL RDBMS.
Feb 20 11:50:04 ewb systemd[1]: Stopped PostgreSQL RDBMS.
Feb 20 11:50:04 ewb systemd[1]: Stopping PostgreSQL RDBMS...
Feb 20 11:50:04 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 20 11:50:04 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 20 11:51:28 ewb systemd[1]: Stopped PostgreSQL RDBMS.
-- Reboot --
Feb 20 11:52:24 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 20 11:52:24 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 20 13:17:00 ewb systemd[1]: Stopped PostgreSQL RDBMS.
Feb 20 13:46:45 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 20 13:46:45 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 20 13:59:00 ewb systemd[1]: Stopped PostgreSQL RDBMS.
-- Reboot --
Feb 20 14:01:25 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 20 14:01:26 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 20 14:06:01 ewb systemd[1]: Stopped PostgreSQL RDBMS.
Feb 20 14:08:54 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 20 14:08:54 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 20 14:20:41 ewb systemd[1]: Stopped PostgreSQL RDBMS.
Feb 20 14:20:41 ewb systemd[1]: Stopping PostgreSQL RDBMS...
Feb 20 14:20:44 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 20 14:20:44 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 20 14:24:31 ewb systemd[1]: Stopped PostgreSQL RDBMS.
-- Reboot --
Feb 20 14:25:30 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 20 14:25:31 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 20 17:38:16 ewb systemd[1]: Stopped PostgreSQL RDBMS.
-- Reboot --
Feb 20 17:39:17 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 20 17:39:17 ewb systemd[1]: Started PostgreSQL RDBMS.
Feb 20 18:01:47 ewb systemd[1]: Stopped PostgreSQL RDBMS.
-- Reboot --
Feb 22 09:03:59 ewb systemd[1]: Starting PostgreSQL RDBMS...
Feb 22 09:04:00 ewb systemd[1]: Started PostgreSQL RDBMS.