centos7 安装 PostgreSql
确定你是管理员,然后运行命令:
yum -y install postgresql-server postgresql-contrib
初始化数据库 postgresql-setup initdb
启动服务 systemctl start postgresql.service
添加开机加载服务 systemctl enable postgresql.service
安装wget
yum install wget
配置postgresql
vi /var/lib/pgsql/data/postgresql.conf
把
#listen_addresses = 'localhost'
改为
listen_addresses = '*'
vi /var/lib/pgsql/data/pg_hba.conf
在
host all all 127.0.0.1/32 ident
下面加上你的电脑ip
host all all 客户端ip/32 password
ip配置规则
32 -> 192.168.1.1/32 表示必须是来自这个IP地址的访问才合法;
24 -> 192.168.1.0/24 表示只要来自192.168.1.0 ~ 192.168.1.255的都合法;
16 -> 192.168.0.0/16 表示只要来自192.168.0.0 ~ 192.168.255.255的都合法;
8 -> 192.0.0.0/16 表示只要来自192.0.0.0 ~ 192.255.255.255的都合法;
0 -> 0.0.0.0/0 表示全部IP地址都合法,/左边的IP地址随便了只要是合法的IP地址即可;
设置数据库密码
centos会自动生成一个postgres用户
所以,切换用户su postgres
会出现bash-4.2$,在后边输入psql回车,会出现postgres=#,
输入:ALTER USER postgres WITH PASSWORD '123456';
这样,把数据库用户postgres的密码设置为123456了
输入 \q 退出 postgresql环境,然后su切换到root用户
重启服务
systemctl restart postgresql.service
centos7 安装 PostgreSql的更多相关文章
- CentOS7安装Postgresql
执行命令 Yum install postgresql-server Yum install postgresql-contrib 安装完成后,检查postgresql的服务状态 Systemctl ...
- Centos7安装 PostgreSQL步骤
1. 安装服务器即可. Yum install postgresql-server Yum install postgresql-contrib 2. 验证是否安装成功: rpm -aq| grep ...
- 阿里云ecs centos7安装 postgresql 9.4
rpm -Uvh http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-3.noarch.rpm yum insta ...
- CentOS7 安装Postgresql 11+ 源码编译安装Postgis-2.5.2
####安装Postgresql-11yum install zlib-devel gcc makegroupadd postgresuseradd -g postgres postgrespassw ...
- centos7安装postgresql和postgis
1.安装步骤 -- 安装对应的rpm文件(其他系统的rpm包,请自行到https://yum.postgresql.org/下载)yum install -y https://download.pos ...
- Centos7 源码安装PostgreSQL Citus集群 (转载)
citus的分布式集群目前在苏宁大规模应用,苏宁陈华军也做了很多技术分享和博客介绍.目前所有的教程都是rpm和pg一起安装,个人不喜欢,毕竟citus定位是个插件,我想在我已安装的pg上源码装一个ci ...
- CentOS7安装配置Bacula yum方法
参考: https://www.baidu.com/link?url=o2QIy2YZWjsJPAFJuYFhrH3nPvtyRkSe-o5Q_FqFZ5E1EMOsIOmGeKm0HAonwHOw8 ...
- centos7 安装配置postgresql
考:https://www.linuxidc.com/Linux/2017-10/147536.htm http://blog.51cto.com/12482328/2090844 https://w ...
- 19.CentOS7下PostgreSQL安装过程
CentOS7下PostgreSQL安装过程 装包 sudo yum install postgresql-server postgresql-contrib 说明: 这种方式直接明了,其他方法也可以 ...
随机推荐
- oracle11g dataguard failover重建后归档日志没有被应用被NO的问题
1.主库从库归档记录不一致.例如以下所看到的: 做完failover后,坏的旧主库变成了新的从库,可是新从库的归档日志记录不一致,就是archive log list;出来的和v$archived_l ...
- HDU 1255 覆盖的面积(线段树+扫描线)
题目地址:HDU 1255 这题跟面积并的方法非常像,仅仅只是须要再加一个变量. 刚開始我以为直接用那个变量即可,仅仅只是推断是否大于0改成推断是否大于1.可是后来发现了个问题,由于这个没有下放,没延 ...
- Java进程堆外内存(off heap)大小
一.使用ByteBuffer.allocateDirect分配的off heap内存大小 本机进程 在Jvisualvm中安装 Mbeans插件.然后查看java.nio/BufferPool/dir ...
- 汉澳Sinox2014X64server高级桌面服务器版操作系统公布
汉澳Sinox2014X64server高级桌面服务器版操作系统公布 当你在现代城市夜空中看到一道闪电.屏幕中央闪过几个图形,转眼间变成美轮美奂的紫色空中天国,说明你来到了汉澳sinox2014世 ...
- Bitmap通过getWidth和getHeight获取尺寸不符
在使用BitmapFactory载入图片时,常会出现这样的情况,返回的图片尺寸与实际尺寸不符.这是因为我们把图片资源放到res/drawable文件路径下时,选择的文件不同所致.不同的目录会有不同的缩 ...
- Codeforces Round #325 (Div. 2) B. Laurenty and Shop 前缀+后缀
B. Laurenty and Shop ...
- java的PrintStream(打印输出流)详解(java_io)
java的PrintStream(打印输出流)详解(java_io) 本章介绍PrintStream以及 它与DataOutputStream的区别.我们先对PrintStream有个大致认识,然后再 ...
- 【转】ACM 2567 -- 树的Prufer编码
本文介绍北京大学ACM网站2567号题目的解法.介绍部分基本翻译自网站上的题目介绍. 题目介绍: 给定一棵各节点编号为整数1,2,3...n的树(例如,无环连通图),其Prufer编码(Pruf ...
- sql server数据库添加记录
转自:http://jingyan.baidu.com/article/f25ef254449a9a482c1b8293.html
- openstack 杂记 备忘002