ubuntu下安装postgresql

sudo apt-get install postgresql-8.3 postgresql-client-8.3 postgresql-contrib-8.3

sudo apt-get install pgadmin3

sudo su postgres -c psql template1
template1=# ALTER USER postgres WITH PASSWORD ‘jaypei’;
template1=# \q

sudo passwd -d postgres
sudo su postgres -c passwd

sudo gedit /etc/postgresql/8.3/main/postgresql.conf

改变行:
#listen_addresses = ‘localhost’
修改为:
listen_addresses = ‘*’
和行:
#password_encryption = on
修改为:
password_encryption = on

sudo gedit /etc/postgresql/8.3/main/pg_hba.conf

host all all [ip address] [subnet mask] md5

sudo /etc/init.d/postgresql-8.3 restart

sudo -u postgres createuser -D -A -P mynewuser
sudo -u postgres createdb -O mynewuser mydatabase

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>