essay | tech | year-summary | about
日期:2019-03-02T00:00:00Z
首先创建用户名和密码(或者使用默认的postgres,然后给它创建一个密码)
sudo su - postgres
createuser {user name}
ctrl + d
psql
$ \password
然后找到postgre的所在地
ps auxw | grep postgres
编辑postgresdql.conf,来接受信息
$PGDATA/postgresql.conf
- #listen_addresses = 'localhost' # what IP address(es) to listen on;
+ listen_addresses = '*' # what IP address(es) to listen on;
编辑pg_hba.conf,来允许接受信息
$PGDATA/pg_hba.conf
host all all 127.0.0.1/32 md5
+ host all all [client_addr]]/32 md5
最后重启系统服务
systemctl restart postgresql
参考资料: