postgresql出现Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.

来源:互联网 发布:买家如何避免淘宝客 编辑:程序博客网 时间:2024/06/06 23:16
在psql进入数据库出现以下错误[postgres@pg data]$ psqlpsql: could not connect to server: No such file or directoryIs the server running locally and acceptingconnections on Unix domain socket "/tmp/.s.PGSQL.5432"?可能出现的原因1:tmp目录的全权限被修改过[root@pg ~]# chown -R postgres:postgres /tmp可能原因2:修改过以下参数unix_socket_directories = '/home/postgres/'       # comma-separated list of directories                                        # (change requires restart)unix_socket_group = ''                 # (change requires restart)unix_socket_permissions = 0777         # begin with 0 to use octal notation更改过存放文件的位置目录(默认是tmp)重启数据库后psql进入数据库出现开始的错误这是我们有几个方法进入数据库一个是指定文件的位置[postgres@pg data]$ psql -h /home/postgres/psql (9.4.4)Type "help" for help.postgres=# 另一个是指定主机[postgres@pg data]$ psql -h 127.0.0.1psql (9.4.4)Type "help" for help.postgres=# 有时候如果你不小心删除了wal日志,导致数据库无法读取wal日志也会出现这种错误,这时候如果你开启了归档还好办,没有话,只能重装数据库了。

0 0
原创粉丝点击