今天没事,所以把postgresql编译了一下,记下过程,以备以后有用
下载:
tar -zxvf postgresql-8.3.1.tar.gz
cd postgresql-8.3.1
./configure --prefix=/usr/local/psql
再果没通过,我少装了readline,错误提示中可以说用--without-readline跳过
./configure --prefix=/usr/local/psql --without-readline
make;make install
。。。。。。。。
终于OK了,
创建postgresql用户及目录
useradd postgres
passwd postgres
mkdir date
chown -R postgres date
切换用户,初始化数据库
su - postgres
/usr/local/psql/bin/initdb -D /usr/local/psql/date
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.
The default database encoding has accordingly been set to EUC_CN.
initdb: could not find suitable text search configuration for locale zh_CN
The default text search configuration will be set to "simple".
fixing permissions on existing directory /usr/local/psql/date ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers/max_fsm_pages ... 32MB/204800
creating configuration files ... ok
creating template1 database in /usr/local/psql/date/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
creating dictionaries ... 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:
./postgres -D /usr/local/psql/date
or
./pg_ctl -D /usr/local/psql/date -l logfile start
运行并创建数据库
[postgres@localhost bin]$ ./postmaster -D /usr/local/psql/date
LOG: database system was shut down at 2008-04-27 13:35:00 CST
LOG: autovacuum launcher started
LOG: database system is ready to accept connections
[postgres@localhost bin]$ ./createdb test
[postgres@localhost bin]$ ./psql test
Welcome to psql 8.3.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
test=#
好了,接下来就可以操作了!
阅读(2620) | 评论(0) | 转发(0) |