【ubuntu】Ubuntu 安装postgreSQL以及图形界面pgadmin3,hstore

1、安装postgreSQL
sudo apt-get install postgresql

2、启动postgreSQL

sudo /etc/init.d/postgresql start

3、登陆postgreSQL

psql -U postgres -d postgres


4、如果出现上面的错误,按照以下方法修改配置文件。

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


【ubuntu】Ubuntu 安装postgreSQL以及图形界面pgadmin3,hstore_第1张图片

将标红的一行中的peer改为trust

重新加载配置文件:


5、重新登陆postgresQL

【ubuntu】Ubuntu 安装postgreSQL以及图形界面pgadmin3,hstore_第2张图片

6、安装图形界面pgadmin3

sudo apt-get install pgadmin3

7、在终端输入pgadmin3会显示图形界面

pgadmin3

【ubuntu】Ubuntu 安装postgreSQL以及图形界面pgadmin3,hstore_第3张图片

8、安装hstore

sudo apt-get install postgresql-contrib

9、重启postgres服务,hstore才能生效

sudo /etc/init.d/postgresql restart

10、登陆psql,给相应的数据库安装插件

create extension hstore
【ubuntu】Ubuntu 安装postgreSQL以及图形界面pgadmin3,hstore_第4张图片


你可能感兴趣的:(【ubuntu】Ubuntu 安装postgreSQL以及图形界面pgadmin3,hstore)