PostgreSQLのLinuxをインストール

1、ラインインストール

yum install postgresql-server -y

図2に示すように、データベースを初期化します

service postgresql initdb

3は、自動的に起動するように設定します

hkconfig postgresql on

4、起動
サービスPostgreSQLの開始を

デフォルトのパスワードを変更する方法

su - postgres
psql
alter user postgres with password 'newpassword';

変更は、サービスを再起動した後、

service postgresql restart或者
/bin/systemctl restart postgresql.service

テスト着陸

psql -h 127.0.0.1 -p 5432 -U postgres

すべての設定(デフォルトはマシンである)の両方をアクセスすることができます

cd /var/lib/pgsql/data/
vim postgresql.conf
listen_addresses = '*'

認証モード、pg_hba.confファイルの増加を設定します。

host    all             all             0.0.0.0/0               password

おすすめ

転載: www.cnblogs.com/tonyzt/p/10980706.html