时间:2021-07-01 10:21:17 帮助过:22人阅读
sudo su - postgres
initdb -D /var/lib/pgsql/data
systemctl status postgresql.service
systemctl start postgresql.service
systemctl stop postgresql.service
修改 /var/lib/pgsql/data/postgresql.conf 文件
listen_addresses =‘*‘
修改 /var/lib/pgsql/data/pg_hba.conf 文件**
host all all 0.0.0.0/0 trust
systemctl restart postgresql.service
$ sudo su - postgres
$ psql -U postgres -W
$ Password for user postgres: postgres
postgres=# CREATE USER <user> WITH PASSWORD ‘<password>‘;
postgres=# CREATE DATABASE test OWNER <user> ENCODING ‘UTF8‘;
$ psql -U kongxx -d test
test=> \dt
版权声明:本文为博主原创文章,未经博主允许不得转载。
CentOS7上安装PostgreSQL
标签:postgresql