postgresql - ubuntu 和 centos 中的 Postgres 连接错误
问题描述
我是postgres的新手。通过 ubuntu 和 centos 连接时出现此错误:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
解决方案
通过编辑 pg_hba.conf 文件中的 ipv4 条目授予所有主机权限。修改后重启postgresql服务。
推荐阅读
- python - 动态创建的组件无法访问父属性
- python - 如何使带有诗歌和 pyproject.toml 的 python 包的开发环境和生产环境之间的依赖关系保持一致
- javascript - 如何创建两个可重用的调用自定义钩子?
- c - C Makefile 不适用于共享库
- html - 通过vba单击网页中的提交按钮
- python - 为什么我的 python 程序不回复套接字消息?
- ruby-on-rails - 如何使用带有“updated_on”时间戳的 Rails 的 HTTP 缓存助手?
- datatables - 提高与 node().id() 绑定的 jQuery 数据表加载速度
- sql-server - 通过输入不完整的 ID 号从 StudentTable 中获取正确的学生 ID
- r - 如何一次查询具有多个关键字的 Mongo 数据库?