PostgreSQL安装配置

yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
yum install postgresql96-server postgresql96-contrib
/usr/pgsql-9.6/bin/postgresql96-setup initdb
systemctl start postgresql-9.6
systemctl enable postgresql-9.6
firewall-cmd --add-service=postgresql --permanent
firewall-cmd --reload
su - postgres
psql -U postgres
ALTER USER postgres with encrypted password 'abc123';
\q
exit
vi /var/lib/pgsql/9.6/data/postgresql.conf
vi /var/lib/pgsql/9.6/data/pg_hba.conf
systemctl restart postgresql-9.6.servicenode

1.下载
yum localinstall https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpmlinux

2.肯定安装
ysql

3.开始安装PostgreSQL
yum -y install postgresql95-server postgresql95-contrib数据库

4.初始化数据库
/usr/pgsql-9.5/bin/postgresql95-setup initdbnpm

5.启动服务
systemctl start postgresql-9.5centos

6.设为开机自启
systemctl enable postgresql-9.5post

7.数据库操做
PostgreSQL的默认用户为“postgres”。
输入“su - postgres”并回车,切换至用户。
输入“psql -U postgres”并回车,登陆数据库。
输入ALTER USER postgres with encrypted password 'abc123';并回车,设置默认用户postgre的密码,此处密码为“abc123”,可自行修改。
输入“\q”并回车, 退出数据库。
输入“exit”并回车,退出用户。命令行

8.配置远程访问
输入“vi /var/lib/pgsql/9.5/data/postgresql.conf”并回车。(若是使用其余版本的PostgreSQL则须要把其中的“9.5”换成对应的版本)

找到“listen_addresses”。
若是想对全部IP开放,则将“localhost”改成“*”便可,若是想仅对部分IP开放,多个IP之间用“, ”(逗号+空格)隔开。
改完以后去掉“listen_address”前面的“#”。
编辑完成后,按“Esc”键,输入“:wq”并回车。 rest

输入“vi /var/lib/pgsql/9.5/data/pg_hba.conf”并回车,将光标移至底部。
(若是使用其余版本的PostgreSQL则须要把其中的“9.5”换成对应的版本) postgresql

按“i”键进入插入编辑模式,在“IPv4 local connections”下方添加容许链接的IP。
若是想容许全部IPv4地址,则加入一行“host all all 0.0.0.0/0 md5”。IPv6方法相似。

9.重启postgresql服务
service postgresql-9.5 restart

 


Node.js 环境安装

1.切换目录命令行:cd /usr/local/src

2.下载命令行: wget https://nodejs.org/dist/v8.9.1/node-v8.9.1-linux-x64.tar.xz

3.解压命令:tar -xvf node-v8.9.1-linux-x64.tar

4.命令行: cd node-v8.9.1-linux-x64/bin/  (能够看到node和npm) ./node -v 查看版本

5.添加环境变量(/etc/profile)
PATH=$PATH:/usr/local/src/node-v8.9.1-linux-x64/bin
(
#set for nodejs

export NODE_HOME=/usr/local/src/node-v8.9.1-linux-x64

export PATH=$NODE_HOME/bin:$PATH

#export PATH=$PATH:/usr/local/src/node-v8.9.1-linux-x64/bin)

相关文章
相关标签/搜索