免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3095 | 回复: 5
打印 上一主题 下一主题

有人在solaris10中用postgresql8.1的原码编译安装成功过吗? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-11-22 13:28 |只看该作者 |倒序浏览
前几天下载了PG8.1的原码包,在solaris10下面编译安装基本上没出什么问题(一些小问题花点时间一一解决),不过安装上了后初始化数据库就出现问题了,操作过程及现象如下:
1). useradd postgres
2).  mkdir /usr/local/pgsql/data
3).  chown postgres /usr/local/pgsql/data
4).  su postgres        (以上四步严格按照用户手册来的)
5).用命令/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data初始化数据库,执行了一两步就报错说:
Fatal:   在/usr/local/pgsql/bin/initdb目录下找不到postgres命令,而此命令在初始化数据库时要用,请检查安装是否正确。

我觉得很奇怪,/usr/local/pgsql/bin下根本就没有initdb这个目录,难道是初始化脚本误认为initdb也是一个目录了?找了半天才发现PG8.1初始化数据库命令不象以前的版本是脚本程序,是由c程序编译而来的。

我曾经有过把源程序拿过来修改一番的冲动,但想想由于自己水平有限,要搞定此问题肯定要耗费不少时间,遂转回8.03版使用去了。

想在版内喊一声,有在solaris10下面搞定的么?有没有碰到我遇到的这个问题呢?

论坛徽章:
0
2 [报告]
发表于 2005-11-22 17:08 |只看该作者
怎么没人理我?
自己顶一顶,免得沉了

论坛徽章:
0
3 [报告]
发表于 2005-11-23 09:58 |只看该作者

  1. PGLIB=/usr/local/pgsql/lib
  2. PGDATA=/usr/local/pgsql/data
  3. PATH=/usr/local/pgsql/bin:$PATH
  4. MANPATH=$MANPATH:/usr/local/pgsql/man
  5. export   PGLIB PGDATA PATH MANPATH
复制代码

可能是你的配置没做好
把上面几行放到你的.profile里面再试一试

论坛徽章:
0
4 [报告]
发表于 2005-11-23 10:04 |只看该作者

回复 1楼 billlion 的帖子

........./usr/local/pgsql/bin下根本就没有initdb这个目录.......


这里可能是你安装有问题,你是按照下面的步骤安装的吗?

  1. cd 源码目录
  2. ./configure --prefix=/usr/local/pgsql
  3. make

  4. su root
  5. make install

复制代码

论坛徽章:
0
5 [报告]
发表于 2005-11-24 16:14 |只看该作者
不知道跟权限有没关系 我是这样作的
chown postgres:postgres /usr/local/pgsql
chown postgresl:postgres /home/pgdata
su - postgres (在linux 不加中的 - 这个根本不可能初始化数据库)
8.1在初始数据库的时候一定要加编码 我试着是的UTF-8

论坛徽章:
0
6 [报告]
发表于 2005-12-25 18:59 |只看该作者

我在hp-ux弄成功了

利用postgresql8.1.1源代码在hp-ux 11.11B上安装的步骤
1、官方文档的步骤
./configure
gmake
su
gmake install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test
2、实际步骤
2.1安装gcc 3.4.2
在hp的网站下载下列软件包到/home/temp
binutils_2.15a_hppa-hp-hpux11.11_depot.gz
gcc_3.4.2_hppa-hp-hpux11.11_depot.gz(没有用最新的4.0.2,因为对postgresql8.1.1源代码make出错)
gunzip *gz
swinstall -s /home/temp/binutils_2.15a_hppa-hp-hpux11.11_depot
swinstall -s /home/temp/gcc_3.4.2_hppa-hp-hpux11.11_depot

2.2安装gmake 3.8.0
退出telnet,重新用root登录
在gnu的网站下载make-3.80.tar.gz软件包到/home/temp
gunzip make-3.80.tar.gz
tar xvf make-3.80.tar
cd make-3.80
./configure
make
./make check
make install

2.3安装postgresql8.1.1
退出telnet,重新用root登录
在postgresql的网站下载postgresql-8.1.1.tar.gz到/home/temp
gunzip *gz
tar xvf postgresql-8.1.1.tar
cd postgresql-8.1.1
./configure CC=gcc --without-readline  --without-zlib (不加2个--without不能成功)
make
make install
useradd postgres (hp-ux没有adduser命令)
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
mkdir /home/postgres
chown postgres /home/postgres (不加这2行postgres用户没有自己的home目录)
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test
只是中文配置有问题
/usr/local/pgsql>mkdir /usr/local/pgsql/data2
/usr/local/pgsql>/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data2
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale zh_CN.hp15CN.
initdb: could not find suitable encoding for locale "zh_CN.hp15CN"
Rerun initdb with the -E option.
Try "initdb --help" for more information.

我用了-E参数
还是不能显示汉字提示
/usr/local/pgsql>/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data2 -E EUC_CN
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale zh_CN.hp15CN.
initdb: warning: encoding mismatch
The encoding you selected (EUC_CN) and the encoding that the selected
locale uses (hp15CN) are not known to match. This may lead to
misbehavior in various character string processing functions. To fix
this situation, rerun initdb and either do not specify an encoding
explicitly, or choose a matching combination.

fixing permissions on existing directory /usr/local/pgsql/data2 ... ok
creating directory /usr/local/pgsql/data2/global ... ok
creating directory /usr/local/pgsql/data2/pg_xlog ... ok
creating directory /usr/local/pgsql/data2/pg_xlog/archive_status ... ok
creating directory /usr/local/pgsql/data2/pg_clog ... ok
creating directory /usr/local/pgsql/data2/pg_subtrans ... ok
creating directory /usr/local/pgsql/data2/pg_twophase ... ok
creating directory /usr/local/pgsql/data2/pg_multixact/members ... ok
creating directory /usr/local/pgsql/data2/pg_multixact/offsets ... ok
creating directory /usr/local/pgsql/data2/base ... ok
creating directory /usr/local/pgsql/data2/base/1 ... ok
creating directory /usr/local/pgsql/data2/pg_tblspc ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 1000
creating configuration files ... ok
creating template1 database in /usr/local/pgsql/data2/base/1 ... ok
initializing pg_authid ... ok
enabling unlimited row size for system tables ... ok
initializing dependencies ... ok
creating system views ... ok
loading pg_description ... ok
creating conversions ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.

Success. You can now start the database server using:

/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data2
or
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data2 -l logfile start

/usr/local/pgsql>/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data2 -l logfile start
postmaster starting
/usr/local/pgsql>/usr/local/pgsql/bin/createdb test2
CREATE DATABASE
/usr/local/pgsql>/usr/local/pgsql/bin/psql -d test2
Welcome to psql 8.1.1, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

test2=# \?
General
\c[onnect] [DBNAME|- [USER]]
connect to new database (currently "test2")
\cd [DIR] change the current working directory
\copyright show PostgreSQL usage and distribution terms
\encoding [ENCODING]
show or set client encoding
\h [NAME] help on syntax of SQL commands, * for all commands
\q quit psql
\set [NAME [VALUE]]
set internal variable, or list all if no parameters
\timing toggle timing of commands (currently off)
\unset NAME unset (delete) internal variable
\! [COMMAND] execute command in shell or start interactive shell
在windows2000英文版(默认语言简体中文)
postgres=# \?
一般选项
\c[onnect] [数据库名|- [用户名称]]
联接到新的数据库 (当前为 "postgres")
\cd [目录名] 改变当前的工作目录
\copyright 显示 PostgreSQL 用法和发布信息
\encoding [编码]
显示或设置客户端编码
\h [名字] SQL 命令的语法帮助, 用 * 可以看所有命令的帮助
\q 退出 psql
\set [名字 [值]]
设置内部变量, 如果没有参数就列出所有
\timing 查询计时开关切换 (目前是 关闭)
\unset 名字 取消(删除)内部变量
\! [命令] 在 shell 里执行命令或者开始一个交互的 shell
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP