configure readline error 安装

在centos里安装postgres

./configure --with-libraries=/usr/local/lib --with-includes=/usr/local/include

.....

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 isn't looking in the proper directory.
Use --without-readline to disable readline support.

 

要安装 readline , readline-dev 开发包,要么使用 --without-readline 选项关闭 readline 功能。

 

yum install readline;

yum install readline-dev;


readline 也就是命令行编辑,关闭的话,你直接用psql 就不能编辑命令行,如果输错指令,不能回滚命令历史记录,只能手工重新输入。

 

./configure --with-libraries=/usr/local/lib --with-includes=/usr/local/include

.....

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;

 

make

make install

chown -R postgres.postgres /usr/local/pgsql

vi /etc/passwd 更改postgres的home 为/usr/local/pgsql

 

su -postgres

mkdir data

export PATH=$PATH:$HOME/bin

export PGDATA=$PATH:$HOME/data

initdb  初始化数据库

postgres -D /usr/local/pgsql/data 或者pg_ctl -D /usr/local/pgsql/data -l logfile start 启动数据库

启动后,可以用pg_ctl stop/start 进行控制

 

/usr/local/pgsql/data/postgresql.conf 可以更改listener和port,

pg_hda.conf 更改允许连接的机器

 


建立数据库
$createdb mydb
PostgreSQL 会返回 “ CREATED DATABASE”的信息,表明数据库建立完成。
$psql mydb
进入交互 psql 工具,建立表:

CREATE TABLE mytable (
id varchar(20),
name varchar(30));

建立完成后,会得到一条 “CREATED” 的信息,表示建立成功。现在插入一条数据:

INSERT INTO mytable values('1', 'abc');

psql 返回 INSERT 18732 1,查询插入是否成功:

SELECT * FROM MYTABLE;

退出 psql ,用 \q 命令。

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值