1.PostgreSQL下载安装
想看详细介绍请看官方文档 : http://www.postgres.cn/docs/9.5/install-procedure.html
1. 安装:
[root@mysqltest1 postgresql-10.1]# ./configure --prefix=/usr/local/pgsql
......
configure: error: in `/usr/local/postgresql-10.1':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
缺少 gcc包, 安装gcc包
[root@mysqltest1 postgresql-10.1]# yum -y install gcc
configure: error: readline library not found</span>
据提示,应该是没有安装 readline包。
3 检查系统是否安装 readline 包
[root@mysqltest1 postgresql-10.1]# rpm -qa | grep readline
readline-6.2-10.el7.x86_64</span>
4 通过 yum 搜索相关的readline 包
[root@mysqltest1 postgresql-10.1]# yum search readline
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.tuna.tsinghua.edu.cn
* updates: mirrors.tuna.tsinghua.edu.cn
================================================================ N/S matched: readline ================================================================
readline-devel.i686 : Files needed to develop programs which use the readline library
readline-devel.x86_64 : Files needed to develop programs which use the readline library
readline-static.i686 : Static libraries for the readline library
readline-static.x86_64 : Static libraries for the readline library
perl-Term-UI.noarch : Term::ReadLine user interface made easy
readline.i686 : A library for editing typed command lines
readline.x86_64 : A library for editing typed command lines
5. 安装 readline-devel 包
[root@mysqltest1 postgresql-10.1]# yum -y install -y readline-devel
6.编译安装
make 编译
make install 安装
7.配置共享库:
LD_LIBRARY_PATH=/usr/local/pgsql/lib
export LD_LIBRARY_PATH</span>
8. 环境变量
[root@mysqltest1 pgsql]# su - pgsql
[root@mysqltest1 pgsql]# vim .bash_profile
export PGHOME=/usr/local/pgsql
export PGDATA=/usr/local/pgsql/data
export PGLIB=/usr/local/pgsql/lib
export PATH=$PGHOME/bin:$PATH
source /home/pgsql/.bash_profile
9.查看环境变量是否生效
[root@mysqltest1 /]# psql -V
psql (PostgreSQL) 10.1
9. 创建用户,跟oracle一样,pgsql需要单独创建一个用户进行管理
useradd pgsql
chown pgsql:pgsql /usr/local/pgsql -R
10. 初始化数据库
由于配置了环境变量,所以此处我们直接执行initdb即可完成db初始化,但在这之前可以通过initdb --help看一下初始化相关的帮助信息:
初始化
initdb -D /usr/local/pgsql/data/
启动服务
pg_ctl -D /usr/local/pgsql/data/ -l /usr/local/pgsql/logs/logfile start
11.启动失败,log文件报错信息:
could not open lock file "/tmp/.s.PGSQL.5432.lock": 权限不够
解决办法:
chown pgsql:pgsql /tmp/.s.PGSQL.5432.lock
12.创建数据库
[pgsql@mysqltest1 data]$ createdb mydb
[pgsql@mysqltest1 data]$ dropdb mydb
13. 访问数据库:
[pgsql@mysqltest1 data]$ psql mydb
psql (10.1)
Type "help" for help.
mydb=#
14. 查看版本
mydb=# select version();'
---------------------------------------------------------------------------------------------------------
PostgreSQL 10.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16), 64-bit
(1 row)
1.PostgreSQL下载安装相关推荐
- PostgreSQL下载安装教程细心版
一.官网下载地址 官网连接:https://www.postgresql.org/ 二.选择windows版本和项目所需对应版本 这里我们选择的是windows的14.6版本进行下载演示 三.安装步骤 ...
- windows10下postgreSQL 下载、安装、启动、关闭
windows10下postgreSQL 下载.安装.启动.关闭 下载 安装 l设置密码和端口,一直next直到安装完成 环境变量
- linux postgresql默认安装目录,postgresql - 三种安装方式(示例代码)
最近接触了postgresql的安装,和大家分享一下. 一.简 介 PostgreSQL 是一种非常复杂的对象-关系型数据库管理系统(ORDBMS),也是目前功能最强大,特性最丰富和最复杂的自由软件数 ...
- PostgreSQL数据库安装Version10.5
PostgreSQL数据库安装,基于版本10.5安装, 在Linux系统上使用*.gz二进制压缩包手动安装. 操作系统:Red Hat Enterprise Linux Server release ...
- PostgreSQL 的安装以及在安装过程中遇到的问题及解决方法
遇到的问题 最近在学习<SQL基础教程>,在安装PostgreSQL的过程中遇到了一些问题,主要有以下两个: There has been an error. Error running ...
- 在windows上安装Postgresql,安装空间数据库postgis引擎,创建可以存储空间点线面的数据库,解决could not open extension control file问题
在windows上安装Postgresql,安装空间数据库postgis引擎,创建可以存储空间点线面的数据库,解决could not open extension control file问题 前面问 ...
- 配置-Postgresql+Postgis安装+Django连接测试
配置-Postgresql+Postgis安装+Django连接测试 VM虚拟机 安装centos7 min版本 1.配置网卡 cd /etc/sysconfig/network-scripts vi ...
- linux下载安装高斯(opengauss)数据库
下载安装 官网下载链接 安装 1.准备安装的XML配置文件 <?xml version="1.0" encoding="UTF-8"?> <R ...
- PostgreSQL(Pgsql)快速开始/ ubuntu、centos下PostgreSQL数据库安装配置/查看已经编译的pg 编译选项
文章目录 一.PostgreSQL是什么 1. Pgsql和Mysql的对比 二.ubuntu 下安装配置postgres sql 数据库 1. [推荐]apt-get 安装postgres 安装和配 ...
最新文章
- python PyQt5 sender(是发出信号的对象)、receiver(接收信号的对象)、slot(插槽)(是对信号做出反应的方法)
- oldboy_09_03day
- Material Design控件使用学习 toolbar+drawerlayout+ Snackbar
- 对Session、Cookie的完全理解
- MVC系列——MVC源码学习:打造自己的MVC框架(一:核心原理)
- SQL像数组一样处理字符串、分割字符串(标量值函数[用户自定义函数])
- python自带的帮助文档
- 微信小程序实现图片翻转效果
- 微信小程序checkbox调整大小
- JS实现拼音(字母)匹配(搜索)汉字(姓名)
- 各进制转换成十进制的方法
- c语言商场收款程序,c语言 如何用switch语句编写一个有关商场购物金额优惠的选择程式...
- 松下LUMIX S1相机断电MDT文件修复MP4视频(LPCM)
- stl string 源代码分析
- 2017美团北京java后台开发
- C语言基础 阶乘:输入一个数,输出它的阶乘。
- 反病毒利器Autoruns和ProcessExplorer, SREng - 本人推荐使用的查毒杀毒辅助工具
- 2021微信红包封面制作!人人都可以拥有自己的红包封面!安卓苹果都可!
- HUAWEI华为笔记本电脑MateBook 13(WRTB-WFE9L)原装出厂系统恢复原厂系统
- 深入理解计算机系统 习题3.4