当前位置:Gxlcms > 数据库问题 > ubuntu下安装PostgreSQL 和 phpPgAdmin

ubuntu下安装PostgreSQL 和 phpPgAdmin

时间:2021-07-01 10:21:17 帮助过:23人阅读

PostgreSQL 是一款强大的高性能的对象关系型数据库管理系统(ORDBMS),采用与BSD一样的授权方式。PostgreSQL是非常适合大型数据库,有许多先进的功能。PostgreSQL支持许多操作系统,包括Linux,FreeBSD,Solaris和Microsoft Windows。

phpPgAdmin 是管理PostgreSQL数据库基于PHP的Web应用程序。使用phpPgAdmin很容易创建一个数据库,创建一个角色,并在Postgres里创建表。下面说说在Ubuntu 下安装 PostgreSQL 和 phpPgAdmin的过程。

第一步:安装 PostgreSQL, phpPgAdmin 和 Apache2

sudo apt-get -y install postgresql postgresql-contrib phppgadmin

 

第二步:配置 PostgreSQL 用户

PostgreSQL使用的用户认证和授权类似UNIX权限角色。默认情况下,PostgreSQL创建了一个名为“Postgres”基本身份验证新用户。要使用PostgreSQL,您需要登录到“Postgres”账户,你可以通过键入:

sudo -u postgres psql

然后更改Postgres角色的密码:\p

 

第三步:配置Apache2

cd /etc/apache2/conf-available/
phppgadmin.conf
注释掉#Require local,添加Allow From all,这样才可以从你的浏览器访问。

 

第四步:配置 phpPgAdmin

编辑文件 /etc/phppgadmin/config.inc.php :

cd /etc/phppgadmin/
config.inc.php
找到 $conf[‘extra_login_security’] = true; 修改为false。

你就可以使用 postgres phpPgAdmin。

 

第五步:重启 PostgreSQL 和 Apache2

systemctl restart postgresql
systemctl restart apache2

 

第六步:测试登录

浏览器输入:http://localhost/phppgadmin/

ubuntu下安装PostgreSQL 和 phpPgAdmin

标签:用户认证   管理   数据库   log   关系   一个数据库   from   大型数据库   程序   

人气教程排行