- 论坛徽章:
- 0
|
我在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 |
|