如何在CentOS 76.56.4 下安装PostgreSQL 9.3 与 phpPgAdmin

如何在CentOS 76.56.4 下安装PostgreSQL 9.3 与 phpPgAdmin,第1张

咱们分两部分说 先说安装 PostgreSQL 93

yum install >

运行安装yum install postgresql93-server postgresql93-contrib

加载数据库service postgresql-93 initdb

启动 chkconfig postgresql-93 on

启动服务 测试是否正常运行

vi /var/lib/pgsql/93/data/postgresqlconf

添加 listen_addresses = ''

编辑 vi /var/lib/pgsql/93/data/pg_hbaconf

配置host host all all  0000/0 md5

重启服务 /etc/initd/postgresql restart

再次编辑 vi /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m tcp -p tcp --dport 5432 -j ACCEPT

重启

service iptables restart

创建数据库 用户名 密码 su  - postgresql

createuser user1

createdb db1

psql

再说一下 安装phpPgAdmin 我一般会用phpMyAdmin 来做 *** 作 这个用的少

下载:phpPgAdmin-51targz ,并解压到到/var/>

配置所管理的数据库的参数:

[root@web-dev-machine phppgadmin]# vi /var/>

其中必须修改的是:

$conf['extra_login_security'] = false;

其他的可以根据所管理的PostgreSQL数据库的安装情况类配置,如:

// Display name for the server on the login screen

 $conf['servers'][0]['desc'] = 'PostgreSQL';

 // Hostname or IP address for server  Use '' for UNIX domain socket

// use 'localhost' for TCP/IP connection on this computer

 $conf['servers'][0]['host'] = '192168100101';

 // Database port on server (5432 is the PostgreSQL default)

$conf['servers'][0]['port'] = 5432;

 // Database SSL mode

// Possible options: disable, allow, prefer, require

// To require SSL on older servers use option: legacy

// To ignore the SSL mode, use option: unspecified

 $conf['servers'][0]['sslmode'] = 'allow';

// Change the default database only if you cannot connect to template1

 // For a PostgreSQL 81+ server, you can set this to 'postgres'

$conf['servers'][0]['defaultdb'] = 'template1';

 // Specify the path to the database dump utilities for this server

 // You can set these to '' if no dumper is available

$conf['servers'][0]['pg_dump_path'] = '/opt/pg932/bin/pg_dump';

 $conf['servers'][0]['pg_dumpall_path'] = '/opt/pg932/bin/pg_dumpall';

注意:以上pg_dump_path和pg_dumpall_path在phpPgAdmin中执行导出数据库时才调用,所以一开始配置错误可能不会看到报错,执行导出时就会报错。

方法2种

直接删除data目录下对应的数据库名称的文件夹下表名文件如tbnamefrm等同名3文件,重启mysql服务就没有了;

进入mysql命令行,直接执行

drop table tbname;

就没有了;

1先找到psql路径

[root@localhost vge]# which -a psql

/usr/bin/psql

/bin/psql

说明:ln命令用来为文件创建连接。连接类型分为硬连接和符号连接两种,默认的连接是硬连接,如果创建符号连接必须使用“-s”选项。

注意:符号链接文件不是一个独立的文件,它是许多属性依赖于源文件,所以给符号链接文件设置存取权限是没有意义的。

2使用新版本连接到默认路径

[root@localhost vge]# mv /usr/bin/psql /usr/bin/psql-bk

[root@localhost vge]# ln -s /usr/local/pgsql/bin/psql /usr/bin/psql

由于是使用 yum 安装的 PostgreSQL

安装位置在 /usr/postgresql-12

所以 psql位置在 /usr/postgresql-12/bin/psql

最后一个命令需要改为

[root@localhost vge]# ln -s /usr/postgresql-12/bin/psql /usr/bin/psql

1、你把其他服务器的这个文件拷贝过来,必须保证系统是一致的

2、用chmod命令,把文件的权限改成你用户的权限(关键)

放上去应该就可以使用了

详细可以到我网站与我交流

以上就是关于如何在CentOS 7/6.5/6.4 下安装PostgreSQL 9.3 与 phpPgAdmin全部的内容,包括:如何在CentOS 7/6.5/6.4 下安装PostgreSQL 9.3 与 phpPgAdmin、centos 7 mysql 彻底删除一个表怎么删、centos8下postgreSQL入门1.2之psql与server版本不一致问题解决等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/sjk/9759455.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-01
下一篇2023-05-01

发表评论

登录后才能评论

评论列表(0条)

    保存