postgresql 常见问题

  • bash-4.1$ psql
    psql: 无法联接到服务器: 没有那个文件或目录
    服务器是否在本地运行并且在 Unix 域套接字
    "/var/run/postgresql/.s.PGSQL.5432"上准备接受联接?
    (psql: could not connect to server: 没有那个文件或目录
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"?)
    问题原因:postgresql service stop
    解决方法:service postgresql-9.6 start
  • psql: could not connect to server: Connection refused
    Is the server running on host "192.168.1.232" and accepting
    TCP/IP connections on port 5432?
解决方法:
#vi postgresql.conf
修改 
#listen_addresses = 'localhost' 
为
listen_addresses = '*' 
  • psql: FATAL: no pg_hba.conf entry for host "192.168.1.223", user "test", database "test", SSL off
解决方法:
#vi pg_hba.conf
添加
local database            user                                       password
host  database            user              0.0.0.0/0           password
host  database            user              ::1/0                  password
  • pg_ctl: directory "/home/postgres/pgdata" is not a database cluster directory
./bin/initdb -D ~/pgdata/
  • ERROR: permission denied for relation #{table_name}
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public  TO #{table_user};
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 1. 数据库安装与配置步骤 安装环境准备操作系统: Oracle Linux Server 6.5IP 地址...
    garyond阅读 8,831评论 0 7
  • sqlmap用户手册 说明:本文为转载,对原文中一些明显的拼写错误进行修正,并标注对自己有用的信息。 ======...
    wind_飘阅读 6,335评论 0 5
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,404评论 19 139
  • http://192.168.136.131/sqlmap/mysql/get_int.php?id=1 当给sq...
    xuningbo阅读 13,532评论 2 22
  • 人生在世,不如意事常八九,可与人言无二三。 生活本就是一部个人的矛盾史,我们一直在惴惴不安中匍匐前进,时不时祈祷一...
    路可阅读 1,534评论 0 0