小工具知识网

当前位置: 首页 > 行业知识 > psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432“ failed: No such file

行业知识

psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432“ failed: No such file

2026-11-24 14:13:17 来源:互联网转载
当我在linux debian版本安装postgres数据库遇到的问题:
root@VM-8-13-debian:~# sudo su - postgrespostgres@VM-8-13-debian:~$ psqlpsql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directoryIs the server running locally and accepting connections on that socket?
帮我解决成功的方法如下:可以直接复制运行,需要看注释

index.php/tags-41973.html" >���骤一:

()
dpkg-reconfigure locales

步骤二:

  • 注意这里的16是我postgres的版本,你要改成你对应的版本数字比如14就改成14,然后出现语言区域我一般默认直接回车
    pg_createcluster 16 main --start

    步骤三:

    ()
    /etc/init.d/postgresql start

    然后就成功了

    sudo su - postgrespsql

    引用来自

    https://askubuntu.com/questions/50621/can-not-connect-to-postgresql-listening-on-port-5432

上一篇:RPM包极速下载攻略

下一篇:轻松掌握技巧,网页浮动窗口添加不求人!