永发信息网

linux 下怎么看postgresql安装到哪个目录了

答案:2  悬赏:70  手机版
解决时间 2021-11-08 04:39
linux 下怎么看postgresql安装到哪个目录了
最佳答案
进入/opt/pgsql-9.1.7目录可以看到安装后的postgresql的文件。
linux下安装PostgreSQL数据库步骤如下:
0.编译环境
全部回答
OS:suselinux11(64bit)
PostgreSQL:PostgreSQL9.1(64bit)
1、建用户及目录
linux:/home # groupadd postgres
linux:/home # useradd postgres -g postgres
linux:/home # mkdir /home/postgres
linux:/home # chown postgres:postgres /home/postgres
linux:/home # passwd postgres
2、用root运行安装(不能以postgres运行安装)
linux:/opt # mkdir /opt/PostgreSQL
linux:/opt # chown postgres:postgres /opt/PostgreSQL
linux:/opt/PostgreSQL # chmod +x postgresql-9.1.1-1-linux-x64.bin
linux:/opt/PostgreSQL # ./postgresql-9.1.1-1-linux-x64.bin
----------------------------------------------------------------------------
Welcome to the PostgreSQL Setup Wizard.
----------------------------------------------------------------------------
Please specify the directory where PostgreSQL will be installed.
Installation Directory [/opt/PostgreSQL/9.1]:
----------------------------------------------------------------------------
Please select a directory under which to store your data.
Data Directory [/opt/PostgreSQL/9.1/data]:
----------------------------------------------------------------------------
Please provide a password for the database superuser (postgres). A locked Unix
user account (postgres) will be created if not present.
Password :
Retype password :
----------------------------------------------------------------------------
Please select the port number the server should listen on.
Port [5432]:
----------------------------------------------------------------------------
Advanced Options
Select the locale to be used by the new database cluster.
Locale
[1] [Default locale]
[2] C
[3] POSIX
...
[441] zu_ZA
[442] zu_ZA.utf8
Please choose an option [1] :
----------------------------------------------------------------------------
Setup is now ready to begin installing PostgreSQL on your computer.
Do you want to continue? [Y/n]: y
----------------------------------------------------------------------------
Please wait while Setup installs PostgreSQL on your computer.
Installing
0% ______________ 50% ______________ 100%
########################################
----------------------------------------------------------------------------
Setup has finished installing PostgreSQL on your computer.
3、相关配置
(1)环境变量
postgres@campost:~> vi .profile(new file)
export PGSQL_HOME=/opt/PostgreSQL/9.1
export PATH=$PGSQL_HOME/bin:$PATH
#export PGDATAS=$PGSQL_HOME/datas
export PGDATA=$PGSQL_HOME/data
export PGDATABASE=postgres
export PGUSER=postgres
#export PGPORT=1234
export PGLOCALEDIR=$PGSQL_HOME/share/locale
export MANPATH=$MANPATH:$PGSQL_HOME/share/man
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PGSQL_HOME/lib
postgres@campost:~> . .profile
配置如上环境表里之后,可以使用psql连接数据库:
postgres@campost:/opt/PostgreSQL/9.1/data> psql
Password:
psql.bin (9.1.1)
Type "help" for help.
postgres=# help
You are using psql, the command-line interface to PostgreSQL.
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
postgres=#
(2)网络配置
加网络信任关系:
----详细信息请参考PostgreSQL document,20.1. pg_hba.conf 文件
vi /opt/PostgreSQL/9.1/data/pg_hba.conf
添加一行:host all all trust
重启数据库:
postgres@campost:~> pg_ctl restart
waiting for server to shut down.... done
server stopped
server starting
此时可以用PgAdmin远程登录postgres用户了,此时只有一个库postgres。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
二都供电所我想知道这个在什么地方
同情.怜悯是最高贵的情操,帮助他人是最神圣的
饭店里叫随便的菜应该是什么
recovery 清除全部数据要多久
求八年级上册人教版英语复习提纲~!急~!!!
[175-(48+36)]x78的竖式
“我存在在你的存在”是孙燕姿哪首歌里的?
小菜兔为何自已吃自己毛我养了3只小白兔每只
深圳龙岗地段稍微好一点的地方单间需要多少钱
古贝春旗舰店鲁008地址有知道的么?有点事想
inter做前缀表达什么意思,求带inter的单词。
DCS和PCS的频率分别是多少?
做金融的 名字取沐之,还是取沐洋,沐阳,沐杨,
自带染发剂到发廊染发,通常要付多少加工费啊
关于山水诗词名句
推荐资讯
nowtheyaretallandbeautiful
合阳县伏六乡中学地址有知道的么?有点事想过
一千kw220v燃烧器的工作电流
poping中怎么抖动身体
我想加盟雅芳化妆品做代理要什么条件啊?
每天看见花草,心中充满希望和美好的句子
推荐一下 vivo X paly 和魅族 MX3哪个好
富平县交警大队车管所地址在哪,我要去那里办
玩酷桌球地址在哪,我要去那里办事,
新关角隧道的简介
日本80S光纤熔接和日本住友熔接机比较哪个好
8 3.1415946什么成语
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?