yum方式安裝ARM架構PostgreSQL10數據庫


系統:

[root@weianvrgv /]# cat /etc/redhat-release

CentOS Linux release 8.2.2004 (Core)

 

安裝中文字符集

[root@weianvrgv /]#yum install glibc-common 

[root@weianvrgv /]#yum install -y langpacks-zh_CN

 

設置中文字符

[root@weianvrgv /]#vi /etc/locale.conf

LANG="zh_CN.utf8"

 

安裝PostgreSQL數據庫(centos8默認安裝的是10版本)

[root@weianvrgv /]#yum install postgresql*

 

切換用戶

[root@weianvrgv /]#su - postgres

 

初始化

/usr/bin/postgresql-setup initdb

 

退出postgres用戶

exit

 

編輯數據庫配置文件

[root@weianvrgv /]#vi /var/lib/pgsql/data/postgresql.conf

listen_addresses = '*'

 

[root@weianvrgv /]#vi /var/lib/pgsql/data/pg_hba.conf

大約在83行添加

host    all             all             0.0.0.0/0            md5

 

啟動數據庫

[root@weianvrgv /]#systemctl restart postgresql

 

切換用戶

[root@weianvrgv /]#su - postgres

 

登錄數據庫

[postgres@weianvrgv ~]$psql

 

修改postgres密碼

ALTER USER postgres WITH PASSWORD 'postgres';

 

退出

\q

退出postgres用戶

[postgres@weianvrgv ~]$exit

 

重啟數據庫

[root@weianvrgv /]#systemctl restart postgresql

 

現在PostgreSQL數據庫可以遠程登錄,用戶名:postgres 密碼:postgres

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM