今天修改pg的端口号port改成5435后重启完数据库的时候直接psql进库的时候进不去
[postgres@node2 data]$ psql
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432

这时,进数据库有两种方式
1、psql 后面加上端口号
[postgres@node2 data]$ psql -p 5435
psql (9.6.1)
Type "help" for help.

postgres=#
2、在环境变量/home/postgres/.bash_profile中加上一句
export PGPORT=5435
然后
[postgres@node2 ~]$ source ~/.bash_profile
[postgres@node2 ~]$ psql
psql (9.6.1)
Type "help" for help.

postgres=#
这样就可以直接进库了
————————————————
版权声明:本文为CSDN博主「奈何流年」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/silenceray/java/article/details/68066514

相关文章:

  • 2022-01-31
  • 2021-12-16
  • 2021-07-30
  • 2021-08-10
  • 2021-12-08
  • 2022-12-23
  • 2021-09-12
  • 2021-08-23
猜你喜欢
  • 2021-07-20
  • 2021-11-28
  • 2021-10-21
  • 2022-01-19
  • 2021-12-21
  • 2021-11-05
  • 2022-12-23
相关资源
相似解决方案