psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?我试着跟踪PostgreSQL: Why psql can't connect to server?,但是在键入之后
sudo service postgresql start我得到:
* Starting PostgreSQL 14 database server * Error: /usr/lib/postgresql/14/bin/pg_ctl /usr/lib/postgresql/14/bin/pg_ctl start -D /var/lib/postgresql/14/main -l /var/log/postgresql/postgresql-14-main.log -s -o -c config_file="/etc/postgresql/14/main/postgresql.conf" exited with status 1:
2021-12-13 10:54:29.791 CET [180] LOG: starting PostgreSQL 14.1 (Ubuntu 14.1-2.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit
2021-12-13 10:54:29.797 CET [180] LOG: could not bind IPv4 address "127.0.0.1": Permission denied
2021-12-13 10:54:29.798 CET [180] WARNING: could not create listen socket for "localhost"
2021-12-13 10:54:29.798 CET [180] FATAL: could not create any TCP/IP sockets
2021-12-13 10:54:30.039 CET [180] LOG: database system is shut down
pg_ctl: could not start server
Examine the log output.之后: sudo /tmp/ -name .s.PGSQL.5432 -> nothing After: systemctl状态postgresql -> system尚未以systemd作为init系统(PID 1)进行引导。不能动手术。未能连接到总线:主机已关闭
怎么修呢?我正在尝试安装chirpstack服务器
发布于 2022-03-31 07:47:08
我也有同样的问题。看起来你像我一样在wsl3中使用Ubuntu。
ps -p 1 -o comm=如果在上面的命令之后得到init,那么就意味着您的ubuntu使用的是SysV而不是systemd。您可以使用以下命令。
sudo service postgresql status
sudo service postgresql start
sudo service postgresql stophttps://stackoverflow.com/questions/70332810
复制相似问题