root@VM-8-13-debian:~# sudo su - postgres postgres@VM-8-13-debian:~$ psql 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?
步骤一:
dpkg-reconfigure locales
步骤二:
pg_createcluster 16 main --start
步骤三:
/etc/init.d/postgresql start
然后就成功了
sudo su - postgres psql
引用来自
https://askubuntu.com/questions/50621/can-not-connect-to-postgresql-listening-on-port-5432