pgAdmin远程连接阿里云主机的PostgreSQL-9.5
来源:互联网 发布:阿里办公软件 编辑:程序博客网 时间:2024/06/01 09:20
主机:阿里云学生机
操作系统:centos7.2
软件版本:
PostgreSQL-9.5
pgAdmin 3
在云主机和本地电脑上安装完postgreSQL和pgAdmin的过程就不再赘述,下面只用来讨论远程连接的这一部分内容。
要想pgAdmin远程连接到postgreSQL首先要满足几个条件:
1.postgresql允许远程的地址连接到自己
2.信任服务器连接
3.防火墙要允许
1.信任所有ip的主机
/var/lib/pgsql/9.5/data/ 用vi 或者 vim命令编辑 pg_hba.conf修改前
<pre name="code" class="plain"># TYPE DATABASE USER ADDRESS METHOD# "local" is for Unix domain socket connections onlylocal all all peer# IPv4 local connections:host all all 127.0.0.1/32 ident# IPv6 local connections:host all all ::1/128 ident# Allow replication connections from localhost, by a user with the# replication privilege.#local replication postgres peer#host replication postgres 127.0.0.1/32 ident#host replication postgres ::1/128 ident修改后
<pre name="code" class="plain"># TYPE DATABASE USER ADDRESS METHOD# "local" is for Unix domain socket connections onlylocal all all trust# IPv4 local connections:host all all 127.0.0.1/32 trusthost all all 0.0.0.0/0 trust
2.允许连接到数据库vim /var/lib/pgsql/9.5/data/postgresql.conf找到被注释掉的 去掉注释,并把localhost改为 * 意思是受所有主机连接到数据库,当然你也可以改成你的ip。不过由于我们的IP地址都是动态获取的,而且大多数情况下我们都是出于局域网之中,所以并不容易知道自己所在主机的公网ip,所以说改成 * 允许所有主机连接即可。<pre name="code" class="plain">#------------------------------------------------------------------------------# CONNECTIONS AND AUTHENTICATION#------------------------------------------------------------------------------# - Connection Settings -listen_addresses = '*' <span></span># what IP address(es) to listen on;listen-address='localhost' # comma-separated list of addresses; # defaults to 'localhost'; use '*' for all # (change requires restart)#port = 5432 # (change requires restart)max_connections = 100 # (change requires restart)#superuser_reserved_connections = 3 # (change requires restart)#unix_socket_directories = '/var/run/postgresql, /tmp' # comma-separated list of directories # (change requires restart)
3.设置防火墙,由于防火墙已经内置了postgreSQL服务,所以我们只需要开放服务即可firewall-cmd --add-service=postgresql --permanent 开放postgresql服务 firewall-cmd --reload 重载防火墙4.重启防火墙总结:这是一个比较简单的过程,实际操作过程中可能会出错,不过这些错误都不是什么大问题,毕竟谁没有踩过几个坑呢。以上内容仅限于记录日常所学,如有错误或者表述不清的地方欢迎大家指正!
1 0
- pgAdmin远程连接阿里云主机的PostgreSQL-9.5
- pgAdmin远程连接Postgresql 服务配置
- postgresql pgadmin 连接服务器
- pgAdmin连接postgresql数据库
- pgAdmin连接远程postgresql服务器,提示致命错误
- 在阿里云ECS装的postgresql远程连接不了的问题
- 远程连接阿里云主机服务器(Linux系统)
- 阿里云主机ubuntu安装Mysql并远程连接的配置过程
- 阿里云远程连接
- 无法远程链接阿里云主机的Mysql数据库
- linux 上安装postgresql 并配置pgadmin iii连接
- pgAdmin能连接PostgreSQL,但是网站不能之解决
- PostgreSQL远程连接,发生致命错误:没有用于主机“…”,用户“…”,数据库“…”,SSL关闭的pg_hba.conf记录
- 使用Xshell5连接阿里云主机失败
- 解决pgadmin连不上postgresql
- 玩玩Linux云主机-连接到远程的服务器上
- 腾讯云主机中MySQL无法远程连接的解决办法
- windows的pgadmin无法连接问题
- Android源码编译---Nexus 设备驱动
- 如何修改Android系统的默认亮度
- 什么是Web App、Hybrid App、 Native App以及区别,当前主流移动和应用程序类型
- 获取session用户信息
- Dubbo项目搭建
- pgAdmin远程连接阿里云主机的PostgreSQL-9.5
- java异常处理
- HDU 1176 免费馅饼 最详细的解答(对于dp新手来说非常好的题目)
- C语言连接MySQL数据库实例
- JAVA的单例模式(用java写一个singleton的例子)。
- codeup100000578B-DayofWeek
- 筹备一个开源项目:opencam,仿照openwrt。
- MySQL常见问题总结
- Ruby meta programming 2(define_method/attr_accessor)