linux debian系统安装Postgresql

来源:互联网 发布:淘宝的情侣装店铺推荐 编辑:程序博客网 时间:2024/05/20 19:45

【debian服务器安装Postgresql】
1. su postgres
2. psql
3. create database theyun;
4. create USER theyun WITH PASSWORD ‘theyun1213456’;
5. GRANT ALL PRIVILEGES ON DATABASE theyun to theyun;
查询数据库: \l ,
退出: \q
删除数据库: drop DATABASE theyun;
删除用户: drop USER theyun;
服务器复制到另一个服务器:scp -r 文件名 root@192.168.100.105:~l

【Postgresql远程链接】
1. find / -name pg_hba.conf
2. nano /etc/postgresql/9.4/main/pg_hba.conf
3. ipv4 host all all 0.0.0.0/0 md5
4. find / -name postgresql.conf
5. nano /etc/postgresql/9.4/main/postgresql.conf
6. listen_addresses项值设定为“*”#号去掉
7. service postgresql restart , (postgresql数据库启动)
或者在主目录下:
1. cd /
2. cd /etc/postgresql/9.4/main
3.修改pg_hba.conf(ipv4 :host all all 0.0.0.0/0 md5)
4. 修改postgresql.conf(listen_addresses项值设定为“*”#号去掉)
5. service postgresql restart , (postgresql数据库启动)

【Navicat客户端远程链接】
Postgresql:
1. 在服务器里找到pg_hab.conf ?find / -name pg_hba.conf
2. 修改此文件?nano /etc/postgresql/9.4/main/pg_hba.conf
3. ipv4此行修改为?ipv4 host all all 0.0.0.0/0 md5

原创粉丝点击