FreeBSD下面安装PostgreSQL。
1、确认pkg版本大于1.1.4,可以用pkg -v查看,如果小于此版本,请升级。
2、在/usr/local/etc/pkg.conf文件中,删除掉repository相关的语句,像PACKAGESITE, MIRROR_TYPE, PUBKEY等(译注:默认就没有)。如果删除这些后pkg.conf成为空文件,那么就把它一块删除吧。
3、创建/usr/local/etc/pkg/repos文件夹,可以用mkdir -p /usr/local/etc/pkg/repos命令创建。
4、在上面的路径下,创建FreeBSD.conf,内容为:
- FreeBSD: {
- url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
- mirror_type: "srv",
- enabled: yes
- }
或
- FreeBSD: {
- url: "http://pkg.FreeBSD.org/${ABI}/latest",
- mirror_type: "srv",
- enabled: "yes"
- }
5、可以使用pkg install postgresql等命令了。
/etc/rc.conf
postgresql_enable="YES"
postgresql_data="xxx"
#postgresql_initdb_flags="--encoding=UTF8 --locale=en_US.UTF-8"
安装过程是极其简单,但是需要注意的是,安装完了需要运行下述命令,否则没法启动。
/usr/local/etc/rc.d/postgresql initdb
如果之前曾经安装过,那么可能出现提示,告诉你版本不统一,这是应该按照提示,删除之前遗留的目录,之后再运行这个命令。
设置初始密码:
首先:
$ psql -U pgsql postgres
然后:
postgres=# \password pgsql
postgres=# \q
最后:
修改/usr/local/pgsql/data/pg_hba.conf文件。
local all pgsql trust
修改为:
local all pgsql md5
SELECT (pg_stat_file('base/'||oid ||'/PG_VERSION')).modification, datname FROM pg_database;
FreeBSD下面安装PostgreSQL。的更多相关文章
- [PostgreSQL] 图解安装 PostgreSQL
图解安装 PostgreSQL [博主]反骨仔 [原文地址]http://www.cnblogs.com/liqingwen/p/5894462.html 序 园友的一篇<Asp.Net Cor ...
- centos6.4下面安装postgresql以及客户端远程连接
一.安装 centos6.4服务器IP:192.168.220.131 window7客户端IP:192.168.199.218 在centos官网http://www.postgresql.org/ ...
- FreeBSD从零开始---安装后配置(一)
一.安装后配置 上次我们说到FreeBSD的安装,这次我们说FreeBSD安装后的配置和简单优化方法. 安装完BSD只是服务器提供服务这条万里长征路的开始,还需要一些基本的设定和优化.不过实际 ...
- Linux CentOS安装postgresql 9.4
一.前言 PostgreSQL通常也简称Postgres,是一个关系型数据库管理系统,适用于各种Linux操作系统.Windows.Solaris.BSD和Mac OS X.PostgreSQL遵循P ...
- CentOS6.5下安装PostgreSQL
一.配置 YUM 仓库 修改原始的 yum 仓库配置: vim /etc/yum.repos.d/CentOS-Base.repo 在[base]和[updates] 节(section)部分的尾部插 ...
- 1.Windows安装PostgreSQL
按照下面的步骤,Windows机器上安装PostgreSQL.请确保已开启第三方防病毒,同时安装. 挑选你想要的PostgreSQL的版本号,可以点击以下链接下载 EnterpriseDB Windo ...
- centos 6.4下安装postgresql 9.2
我的linux版本是centos 6.4 ,准备安装postgresql 9.2 根据官方说明: http://www.postgresql.org/download/linux/redhat/ 缺省 ...
- 安装postgreSQL出现configure:error:readline library not found解决方法
要安装 readline , readline-dev 开发包,要么使用 --without-readline 选项关闭 readline 功能. #yum install readline; #yu ...
- ubuntu安装postgresql与postgis
版本信息 ubuntu 14.04.1LTS postgresql 9.3.5 postgis 2.1.2 今天尝试着安装了postgis 2.1.2,(较简便的包安装,不是源码 ...
随机推荐
- android示例:一个简单的登陆程序
最近写了个简单的登陆程序,有几点收获: 1.懂得如何在LinearLayout中嵌套LinearLayout,完善布局的行列: 2.用android:layout_weight控制控件的比重: 3.用 ...
- 97. Interleaving String (String; DP)
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example,Given:s1 = ...
- TZOJ 2754 Watering Hole(最小生成树Kruskal)
描述 Farmer John has decided to bring water to his N (1 <= N <= 300) pastures which are convenie ...
- mysql基本的增删改查和条件语句
增 insert into 表名(列名,列名......) values("test1",23),("test2",23),("test3" ...
- JAVA list集合两种去重方法
结果: 转载地址:http://geek.csdn.net/news/detail/127940
- windows常用的cmd网络命令
一.ping 它是用来检查网络是否通畅或者网络连接速度的命令.作为一个生活在网络上的管理员或者黑客来说,ping命令是第一个必须掌握的DOS命令,它所利用的原理是这样的:网络上的机器都有唯一确定的IP ...
- python的代码检查
#!/bin/python3.4# coding=utf-8 class lexicon(object): # direction = ['north', 'south', 'east', 'west ...
- 详解html中的元老级元素:“table”
table标签历史悠久,在互联网出现的早期,web网页的排版主要是靠table表格,对web网页做出了不可磨灭的贡献,直到后来层叠样式表:CSS的发展完善,再配合空元素DIV,才有了今天绚丽多彩的网页 ...
- tomcat中如何配置虚拟路径
第一步:打开server.xml配置文件.在Host节点里写上该行代码: <Context path="/upload" docBase="E:\upload&qu ...
- flask_hello world
对于flask框架的学习全部借鉴于http://www.pythondoc.com/flask-mega-tutorial/index.html 在学习的过程中,我使用的是Pycharm IDE,Py ...