basic postgres sql

sudo apt-get install postgresql phppgadmin
sudo apt-get install pgadmin3

sudo su - postgres

createuser drupal
Shall the new role be a superuser? (y/n) y

psql -d postgres -U postgres

alter user postgres with password 'crazylongpassword';
or
# \password postgres

\q

edit the main PostgreSQL access control file
sudo vim /etc/postgresql/9.1/main/pg_hba.conf

# Database administrative login by Unix domain socket
local all postgres peer
local all drupal trust

restrict connections to allow only localhost
sudo vim /etc/postgresql/9.1/main/postgresql.conf

# - Connection Settings -

listen_addresses = 'localhost'


sudo service postgresql restart
* Restarting PostgreSQL 9.1 database server


Create a database

createdb -p 5432 -O drupal -U drupal -E UTF8 testingsiteone -T template0

Dropping the database

dropdb -p 5432 -U drupal testingsiteone

Dumping the database

pg_dump -p 5432 -h localhost -Fc -U drupal --no-owner testingsiteone > /tmp/testingsiteone_$(date +"%Y-%m-%d_%s").pgdump

Restoring the database

pg_restore -p 5432 -h localhost -Fc -d testingsiteone -U drupal --no-owner < /tmp/path-to-the-file.pgdump


http://www.pixelite.co.nz/article/installing-and-configuring-postgresql-91-ubuntu-1204-local-drupal-development

start server
sudo service postgresql start
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值