加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

PostgreSQL 安装,使用总结

发布时间:2020-12-13 17:08:57 所属栏目:百科 来源:网络整理
导读:PostgreSQL 安装 #yum install postgresql93-server postgresql93-contrib #service postgresql-9.3 initdb // 设置postgreSQL 自动启动 #chkconfig postgresql-9.3 on #vi /var/lib/pgsql/9.3/data/pg_hba.conf (replace "ident" with "md5") (new config l

PostgreSQL 安装
#yum install postgresql93-server postgresql93-contrib
#service postgresql-9.3 initdb

// 设置postgreSQL 自动启动
#chkconfig postgresql-9.3 on

#vi /var/lib/pgsql/9.3/data/pg_hba.conf
(replace "ident" with "md5")
(new config line)host all all 192.168.1.1(localhost ip)/16 md5

#vi /var/lib/pgsql/9.3/data/postgresql.conf
listen_addresses = '*'
port = 5432

#su - conversant
$sudo service postgresql-9.3 start
$sudo su - postgres
$psql
postgres=# alter user postgres with password 'qa654321';
postgres=# create database testdb;


$sudo su - postgres
$psql -d testdb-U postgres
testdb=#i /opt/app/xxxx-PostgreSQL.sql

$sudo /sbin/iptables -I INPUT -p tcp --dport 5432 -j ACCEPT
$sudo /etc/rc.d/init.d/iptables save
$sudo /etc/init.d/iptables status

退出数据库:q


修改PostgreSQL 密码:

http://www.360doc.com/content/13/0822/10/10384031_309039914.shtml

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读