- 工信部備案號 滇ICP備05000110號-1
- 滇公安備案 滇53010302000111
- 增值電信業(yè)務(wù)經(jīng)營許可證 B1.B2-20181647、滇B1.B2-20190004
- 云南互聯(lián)網(wǎng)協(xié)會理事單位
- 安全聯(lián)盟認(rèn)證網(wǎng)站身份V標(biāo)記
- 域名注冊服務(wù)機(jī)構(gòu)許可:滇D3-20230001
- 代理域名注冊服務(wù)機(jī)構(gòu):新網(wǎng)數(shù)碼
centos用yum安裝postgresql的路徑為 /var/lib/pgsql/中。
1.安裝postgresql9.0 yum 倉庫
rpm -i http://www.tjdsmy.cn/9.2/redhat/rhel-6-x86_64/pgdg-redhat92-9.2-7.noarch.rpm
2.安裝新版本的Postgresql
yum install postgresql92-server postgresql92-contrib
3.初始化數(shù)據(jù)庫
/etc/init.d/postgresql-9.2 initdb
4.啟動數(shù)據(jù)庫
/etc/init.d/postgresql-9.2 start
注意:postgresql啟動后就可以利用service postgresql-9.2 start/restart/stop來控制它了。
雖然打完service后,按p不提示postgresql-9.2,但是可以用手輸。
5.把postgresql加入自啟動列表
cd /etc/init.d
chkconfig --add postgresql9.2
6.查看一下自啟動列表
chkconfig --list
在這里可以看到postgresql已經(jīng)在其中了。
7.PostgreSQL 數(shù)據(jù)庫默認(rèn)會創(chuàng)建一個postgres的數(shù)據(jù)庫用戶作為數(shù)據(jù)庫的管理員,默認(rèn)密碼為空,我們需要修改為指定的密碼,這里設(shè)定為’postgres’
直接在控制臺輸入以下命令:
# su - postgres
$ psql
# ALTER USER postgres WITH PASSWORD 'postgres'; # select * from pg_shadow ;
# create database david;
# c david
david=# create table test (id integer, name text);
david=# insert into test values (1,'david');
至上,安裝成功。
-----------------------------------------------------------
ps:1.可以通過查找pg_hba.conf,來定位postgresql的位置。
2.重啟postgresql,可以用service postgresql restart
售前咨詢
售后咨詢
備案咨詢
二維碼
TOP