对于昨天的【Ident authentication failed for postgres】问题,今天搜索了一天,还没有解决,网上的帖子基本是的解决方案是修改文件pg_hpa.conf里的内容(修改的是红线框里的内容),但都没有成功,如图所示。


今天我还修改了db.url文件内容,参考是官网教程,如图所示:

如果只是用postgres用户和密码,登录到PostgreSQL数据库,是可以登录到数据库,可以对数据库进行增删改等操作。
今天也学习了一下PostgreSQL数据库的常用命令
su - postgres //切换用户
service postgresql status //查看服务状态
service postgresql //start启动postgresql-9.4服务
ps -ef | grep postgres //查postgres的进程信息
netstat -tpnl | grep 5432 //查postgres的端口号5432是否已经打开
service postgresql status //查看服务状态
psql -U postgres //postgres用户连接pgsql server
chkconfig postgresql on //设置开机启动postgresql
service postgresql restart //重启数据库
总之,今天主要是练习了操作PostgreSQL数据库,明天继续解决问题
网友评论