标签:inux processes follow x64 ini amp erp 列表 tcp
下载链接: https://www.enterprisedb.com/download-postgresql-binaries2.创建用户并设置密码
useradd postgres && passwd postgres
3.创建postgres的数据目录并授权
mkdir -p /opt/postgres/pg_data && chown -R postgres:postgres /opt/postgres/pg_data
4.切换到postgres用户启动数据库,并初始化数据库
su - postgres && /opt/postgres/pgsql/bin/initdb -D /opt/postgres/pg_data/
5.启动数据库
/opt/postgres/pgsql/bin/pg_ctl -D /opt/postgres/pg_data/ -l logfile start
[postgres@linux-node1 ~]$ netstat -lnupt|grep 5432
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 127.0.0.1:5432 0.0.0.0: LISTEN 23546/postgres
tcp6 0 0 ::1:5432 ::: LISTEN 23546/postgres
6.登录数据库
[postgres@linux-node1 pgsql]$ ./bin/psql -h localhost -d postgres -U postgres -p 5432
\l 查看数据库列表 \q退出交互界面
7.停止数据库
/opt/postgres/pgsql/bin/pg_ctl -D /opt/postgres/pg_data/ stop
标签:inux processes follow x64 ini amp erp 列表 tcp
原文地址:https://blog.51cto.com/guokang/2512399