Linux安装Postgresql10
CentOS6.5
To use the PostgreSQL Yum Repository, follow these steps:
Select version: 10
Select platform: centos6
Select architecture: x86_64
1:Install the repository RPM:
yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-6-x86_64/pgdg-centos10-10-2.noarch.rpm
2:Install the client packages:
yum install postgresql10
3:Optionally install the server packages:
yum install postgresql10-server
4:Optionally initialize the database and enable automatic start:
service postgresql-10 initdb
chkconfig postgresql-10 on
service postgresql-10 start
CentOS7
yum install postgresql-server
postgresql-setup initdb
cd /var/lib/pgsql/data/
vi pg_hba.conf
host all all 0.0.0.0/0 md5
su - postgres
ALTER USER postgres WITH PASSWORD '123456';
vi postgresql.conf
listen_addresses = '*'
systemctl start postgresql
systemctl status postgresql
systemctl enable postgresql
pgadmin4
官网下载pgadmin4-4.17-py2.py3-none-any.whl
yum install gcc python-devel
yum -y install epel-release
yum -y install python-pip
pip install --upgrade pip
pip install pgadmin4-4.17-py2.py3-none-any.whl
cd /usr/python-3.8.0/lib/python3.8/site-packages/pgadmin4/
vi config.py
DEFAULT_SERVER = '0.0.0.0'
python /usr/python-3.8.0/lib/python3.8/site-packages/pgadmin4/pgAdmin4.py
http://127.0.0.1:5050
To use the PostgreSQL Yum Repository, follow these steps:
Select version: 10
Select platform: centos6
Select architecture: x86_64
1:Install the repository RPM:
yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-6-x86_64/pgdg-centos10-10-2.noarch.rpm
2:Install the client packages:
yum install postgresql10
3:Optionally install the server packages:
yum install postgresql10-server
4:Optionally initialize the database and enable automatic start:
service postgresql-10 initdb
chkconfig postgresql-10 on
service postgresql-10 start
CentOS7
yum install postgresql-server
postgresql-setup initdb
cd /var/lib/pgsql/data/
vi pg_hba.conf
host all all 0.0.0.0/0 md5
su - postgres
ALTER USER postgres WITH PASSWORD '123456';
vi postgresql.conf
listen_addresses = '*'
systemctl start postgresql
systemctl status postgresql
systemctl enable postgresql
pgadmin4
官网下载pgadmin4-4.17-py2.py3-none-any.whl
yum install gcc python-devel
yum -y install epel-release
yum -y install python-pip
pip install --upgrade pip
pip install pgadmin4-4.17-py2.py3-none-any.whl
cd /usr/python-3.8.0/lib/python3.8/site-packages/pgadmin4/
vi config.py
DEFAULT_SERVER = '0.0.0.0'
python /usr/python-3.8.0/lib/python3.8/site-packages/pgadmin4/pgAdmin4.py
http://127.0.0.1:5050