- 论坛徽章:
- 0
|
本帖最后由 weijinxian 于 2010-03-15 14:49 编辑
ubuntu 9.10莫名调试失败,最终主要体现在ddd界面出来后的输入框均不可写。
无奈,转战opensuse 11.2.以下是源码安装postgresql的全过程:
1 去postgresql.org下载源码(目前为8.4.2),解压后把postgresql-8.4.2文件放在home下
2 cd /postgresql-8.4.2
3 ./configure --enable-debug --enable-cassert --without-readline --without-zlib
#本来不想without的,在ubuntu下完全可以sudo apt-get install libreadline5-dev和sudo apt-get install zlib1g-dev安装这两个默认缺失的包
但是opensuse默认没有apt-get,试图安装apt-get却失败(官方说11.2版本下 YaST->software management 输入apt就可以安装,但是我么有搜到)
然后用suse的zypper显然就么有找到要安装的包,只能退而求其次选择without了(谁有办法一定告诉我哦 )
4 gmake
# 你会看到all of 。。。。。。。ready to install
5 gmake check
# 用做测试的,完全可以跳过这一步,但这个命令不能在root下进行
6 sudo gmake install
# 就等它安装呗,默认就装在usr/local/pgsql
7 sudo -su root
8 mkdir /usr/local/pgsql/data
9 cd /usr/local/pgsql/bin
10 sudo -su postgres
#如果没有这个用户那么用groupadd postgres 和useradd -g postgres postgres.
如果需要密码,那么进入user and group管理处,修改下postgres的密码(这也只是权宜之计,但是确实解决了postgres默认随机密码的问题)
11 ./initdb -D /usr/local/pgsql/data
#出现一堆ok,并且有
Success. You can now start the database server using:
./postgres -D /usr/local/pgsql/data
or
./pg_ctl -D /usr/local/pgsql/data -l logfile start
12 ./postgres -D /usr/local/pgsql/data
#会出现三行log,最后有一行data system is ready to accept connections
我尝试过./pg_ctl -D /usr/local/pgsql/data -l logfile start但是会出现permission denied等问题
13 接着我用重新开了个terminal,sudo -su postgres 并且cd /usr/local/pgsql/bin
14 ./createdb mydb
15 ./psql mydb
#之后就随意打打 create table test (first int ,second char);
select pg_backend_pid();
16 switch user 进入postgres
# 直接sudo -su postgres 不能达到效果
17 打开terminal输入 ddd /usr/local/pgsql/bin/postgres
看到源码了, |
|