"卜算子·大数据" is an open source and systematic big data learning tutorial. ——Updated every Sunday
Main content of this section:
For detailed steps to create a server, see Chapter 2 Linux. The key steps are as follows.
sudo vim /etc/apt/sources.list.d/pgdg.list
deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main
< div class="se-preview-section-delimiter"></div>
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update
sudo apt install postgresql-10
Log in to Postgresql
sudo -u postgres psql postgres
change Password
ALTER ROLE postgres PASSWORD 'wxl1234';
Create new user, new database
ALTER ROLE postgres PASSWORD 'wxl1234';
Create new user, new database
CREATE ROLE busuanzi WITH PASSWORD 'wxl123' LOGIN ;
CREATE DATABASE busuanzidb OWNER 'busuanzi';
drop out
Modify postgresql.conf
Modify postgresql.conf
sudo vim /etc/postgresql/10/main/postgresql.conf
The revised content is as follows
listen_addresses ='*'
Modify pg_hba.conf
sudo vim /etc/postgresql/10/main/pg_hba.conf
The revised content is as follows
local all postgres md5
# TYPE DATABASE USER ADDRESS METHOD
# " local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
host all all 192.168.56.0/0 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all peer
host replication all 127.0.0.1/32 md5
host replication all ::1/128 md5
Restart postgresql service
sudo service postgresql restart
Recommended Posts