安装postgreSQL出现configure:error:readline library not found解决方法
要安装 readline , readline-dev 开发包,要么使用 --without-readline 选项关闭 readline 功能。
#yum install readline;
#yum install readline-dev;
readline 也就是命令行编辑,关闭的话,你直接用psql 就不能编辑命令行,如果输错指令,不能回滚命令历史记录,只能手工重新输入。
在安装postgreSQL的过程中遇到一个问题,在执行 configure
过程中报以下错误,configure: error: readline library not found ,可是我在系统中安装
readline 包了,
1 环境信息
2 根据提示,测试了下 configre命令,果然报这个错
[root@HK81-107 postgresql-9.0.0]# ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking which template to use... linux
checking whether to build with 64-bit integer date/time support... yes
checking whether NLS is wanted... no
checking for default port number... 5432
checking for block size... 8kB
checking for segment size... 1GB
checking for WAL block size... 8kB
checking for WAL segment size... 16MB
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking if gcc supports -Wdeclaration-after-statement... yes
checking if gcc supports -Wendif-labels... yes
checking if gcc supports -fno-strict-aliasing... yes
checking if gcc supports -fwrapv... yes
checking whether the C compiler still works... yes
checking how to run the C preprocessor... gcc -E
checking allow thread-safe client libraries... yes
checking whether to build with Tcl... no
checking whether to build Perl modules... no
checking whether to build Python modules... no
checking whether to build with GSSAPI support... no
checking whether to build with Kerberos 5 support... no
checking whether to build with PAM support... no
checking whether to build with LDAP support... no
checking whether to build with Bonjour support... no
checking whether to build with OpenSSL support... no
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for ranlib... ranlib
checking for strip... strip
checking whether it is possible to strip libraries... yes
checking for ar... ar
checking for tar... /bin/tar
checking whether ln -s works... yes
checking for gawk... gawk
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for bison... no
configure: WARNING:
*** Without Bison you will not be able to build PostgreSQL from CVS nor
*** change any of the parser definition files. You can obtain Bison from
*** a GNU mirror site. (If you are using the official distribution of
*** PostgreSQL then you do not need to worry about this, because the Bison
*** output is pre-generated.)
checking for flex... no
configure: WARNING:
*** Without Flex you will not be able to build PostgreSQL from CVS nor
*** change any of the scanner definition files. You can obtain Flex from
*** a GNU mirror site. (If you are using the official distribution of
*** PostgreSQL then you do not need to worry about this because the Flex
*** output is pre-generated.)
checking for perl... /usr/bin/perl
configure: using perl 5.8.8
checking for main in -lm... yes
checking for library containing setproctitle... no
checking for library containing dlopen... -ldl
checking for library containing socket... none required
checking for library containing shl_load... no
checking for library containing getopt_long... none required
checking for library containing crypt... -lcrypt
checking for library containing fdatasync... none required
checking for library containing gethostbyname_r... none required
checking for library containing shmget... none required
checking for -lreadline... no
checking for -ledit... no
configure: error: readline library not found
If you have readline already installed, see config.log for details on the
failure. It is possible the compiler isnt looking in the proper directory.
Use --without-readline to disable readline support.
根据提示,应该是没有安装 readline包。
3 检查系统是否安装 readline 包
[root@HK81-107 postgresql-9.0.0]# rpm -qa | grep readline
readline-5.1-3.el5
说明系统已经安装了 readline包。
4 通过 yum 搜索相关的 readline 包
[root@HK81-107 postgresql-9.0.0]# yum search readline
lftp.i386 : A sophisticated file transfer program
lftp.i386 : A sophisticated file transfer program
php-readline.i386 : Standard PHP module provides readline library support
lftp.i386 : A sophisticated file transfer program
readline.i386 : A library for editing typed command lines.
compat-readline43.i386 : The readline 4.3 library for compatibility with older software.
readline-devel.i386 : Files needed to develop programs which use the readline library.
readline.i386 : A library for editing typed command lines.
根据提示,有一个包引起了注意 "readline-devel", 猜想可能与这个包有关。
5 安装 readline-devel 包
[root@HK81-107 postgresql-9.0.0]# yum -y install -y readline-devel
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package readline-devel.i386 0:5.1-3.el5 set to be updated
--> Processing Dependency: libtermcap-devel for package: readline-devel
--> Running transaction check
---> Package libtermcap-devel.i386 0:2.0.8-46.1 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
readline-devel i386 5.1-3.el5 base 146 k
Installing for dependencies:
libtermcap-devel i386 2.0.8-46.1 base 56 k
Transaction Summary
=============================================================================
Install 2 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 201 k
Downloading Packages:
(1/2): libtermcap-devel-2 100% |=========================| 56 kB 00:00
(2/2): readline-devel-5.1 100% |=========================| 146 kB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: libtermcap-devel ######################### [1/2]
Installing: readline-devel ######################### [2/2]
Installed: readline-devel.i386 0:5.1-3.el5
Dependency Installed: libtermcap-devel.i386 0:2.0.8-46.1
Complete!
6 再次执行 configure 成功。
7 还有一种解决方法:在configure 加上参数 --without-readline ,不过这样就不可以在命令行里面输入了,所以不建议这样。。。
8 configure 成功之后接着就是make了
9 make之后就是make install之后安装成功的话就会出现如下图所示的界面
10.修改postgreSQL安装目录的权限,默认的安装目录在/usr/local/pgSQL下
修改权限命令为chmod -R 777 /usr/local/pgSQL
运行之后pgSQL目录下面的所有文件都会有XWR(X:可执行,W:可写,R:可读)权限。命令中的-R参数说明是
递归的把文件夹pgSQL目录及其目录下的所有文件都修改为相应的权限,777就是代表加上对本用户,本用户组的其他用户和不是这个组的用户增加XWR权
限。
11.
到此,PostgreSQL的安装完成了,接下来可以试着用用这个开源数据库啦…
1):首先是初始化数据库。进入刚刚安装PG的文件夹/home/pg/postgr(这是我安装pg的目录,默认的安装目录是在/usr/local/pgSQL下),输入./bin/initdb –D ../data. 这里的命令格式还需要查明白,特别是-D等参数的意义。这样会在postgr下面产生一个data文件夹。
2):启动数据库服务器。./bin/postmaster –D ./data&.
其中&的意义需要弄明白,差这一个符号就会导致一定的问题,貌似启动数据库服务器还可以使用另外的命令:/bin/postgres -D
./data 或者是 ./bin/pg_ctl -D ./data -l logfile
start。这些命令的区别可以自己查查手册或者咨询一下助教。
3):在另外一个命令行下面,创建一个本地数据库。./bin/createdb testdb,其中testdb是数据库名。在data目录下会产生一个文件夹
4):链接数据库服务器。./bin/psql testdb. 此时,输入help可以获得帮助。见下图
5):访问数据库。这里就是输入sql命令了,以后调试的入口就是这里吧。结束后按\q退出。
6):最后是关闭数据库服务器。./bin/pg_ctl stop –D ./data.
12.That's all!
另外可能会报下面的问题:
./configure --prefix=/usr/local/pgsql
.....
configure: error: zlib library not found
If you have zlib already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
Use --without-zlib to disable zlib support.
解决方法
yum install zlib-devel;
参考:
http://www.cnblogs.com/shuaixf/archive/2011/11/29/2268292.html
http://www.cnblogs.com/shuaixf/archive/2011/11/29/2268298.html
安装postgreSQL出现configure:error:readline library not found解决方法的更多相关文章
- 安装postgreSQL出现configure: error: zlib library not found解决方法
./configure --prefix=/usr/local/pgsql ..... configure: error: zlib library not foundIf you have zlib ...
- error: pcap library not found! 解决方法
参考: error: pcap library not found! error: pcap library not found! 解决方法 $ sudo apt-get install libsql ...
- php安装redis扩展'checking for igbinary includes... configure: error: Cannot find igbinary.h'解决方法
今天准备给yii2安装redis扩展,先安装了redis服务,然后安装redis php官方扩展,在make的时候提示' checking for igbinary includes... confi ...
- MySQL编译安装错误:No curses/termcap library found的解决方法
CentOS编译安装MySQL,./coonfigure时出现错误: checking for termcap functions library... configure: error: No cu ...
- configure error libmcrypt was not found解决方法
安装到mcrypt的时候出现了问题./configure提示出错,首先提示*** Could not run libmcrypt test program, checking why-*** The ...
- python安装locustio报错error: invalid command 'bdist_wheel'的解决方法
locust--scalable user load testing tool writen in Python(是用python写的.规模化.可扩展的测试性能的工具) 安装locustio需要的环境 ...
- configure: error: zlib library and headers are required
configure: error: zlib library and headers are required (1)直接看是zlib没安装导致的,yum list |grep zlib* 看到的是全 ...
- configure: error: MySQL library not found
在CentOS系统中,安装zabbix进行configure时会遇到以下问题 ./configure --enable-server --enable-agent --with-mysql --wit ...
- linux下安装svn出现configure: error: We require OpenSSL; try --with-openssl
linux下安装svn出现configure: error: We require OpenSSL; try --with-openssl http://blog.csdn.net/woshixion ...
随机推荐
- PAT 10-0 说反话
我写了两种实现方法,其中第二种是参考Yomman园友的(http://www.cnblogs.com/yomman/p/4271949.html).我的方法(方法一)是用一个数组存放输入的字符串,另一 ...
- Android异步更新UI的四种方式
Android异步更新UI的四种方式 2015-09-06 09:23 segmentfault 字号:T | T 大家都知道由于性能要求,android要求只能在UI线程中更新UI,要想在其他线程中 ...
- Manacher算法 , 实例 详解 . NYOJ 最长回文
51 Nod http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1089 Manacher 算法 定义数组 p[i]表示以i为 ...
- linux常用命令:3文件搜索命令
文件搜索命令 1. 命令名:find 命令所在路径:/bin/find 执行权限:所有用户 语法:find [搜索范围] [匹配条件] 功能描述:文件搜索 文件搜索类型 通过文件名搜索 -name ...
- 作业3-个人项目<词频统计>
上了一天的课,现在终于可以静下来更新我的博客了. 越来越发现,写博客是一种享受.来看看这次小林老师的“作战任务”. 词频统计 单词: 包含有4个或4个以上的字 ...
- ios openURL的使用(调用系统电话、浏览器、地图、邮件等)
Safari Any URL starting with http:// which does not point to maps.google.com or www.youtube.com is s ...
- hdu5853 (后缀自动机)
Problem Jong Hyok and String 题目大意 给你n个字符串,有q个询问. 定义set(s)={(i,j)} 表示 s在第i个字符串中出现,且末尾位置为j. 对于一个询问,求se ...
- HDU 5000
http://acm.hdu.edu.cn/showproblem.php?pid=5000 题意:有n种属性,每种属性的数值可以是0-T[i],当一个人属性全部小于等于另一个人的属性时,小的那个人会 ...
- 【转发】构建高可伸缩性的WEB交互式系统(中)
原文转自:http://kb.cnblogs.com/page/503953/ 在<构建高可伸缩性的WEB交互式系统>的第一篇,我们介绍了Web交互式系统中平台的可伸缩性.本文将描述模块的 ...
- PHP startsWith and endsWith
function startsWith($haystack, $needle) { // search backwards starting from haystack length characte ...