CentOS7.6上安装postgreSQL
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了CentOS7.6上安装postgreSQL,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1881字,纯文字阅读大概需要3分钟。
内容图文
![CentOS7.6上安装postgreSQL](/upload/InfoBanner/zyjiaocheng/522/fc0b0bde7365445a83c5aea2d85bdcb1.jpg)
上传安装包到服务器(rz工具)
[root@centos7-6 ~]# mkdir /pg-rpm [root@centos7-6 ~]# rz rz waiting to receive. Starting zmodem transfer. Press Ctrl+C to cancel. Transferring postgresql12-12.2-1PGDG.rhel7.x86_64.rpm... 100% 2773 KB 2773 KB/sec 00:00:01 0 Errors Transferring postgresql12-libs-12.2-1PGDG.rhel7.x86_64.rpm... 100% 758 KB 758 KB/sec 00:00:01 0 Errors Transferring postgresql12-server-12.2-1PGDG.rhel7.x86_64.rpm... 100% 13275 KB 13275 KB/sec 00:00:01 0 Errors
[root@centos7-6 ~]# cd /pg-rpm/ [root@centos7-6 pg-rpm]# ll -h total 17M -rw-r--r--. 1 root root 2.8M Apr 5 00:33 postgresql12-12.2-1PGDG.rhel7.x86_64.rpm -rw-r--r--. 1 root root 759K Apr 5 00:36 postgresql12-libs-12.2-1PGDG.rhel7.x86_64.rpm -rw-r--r--. 1 root root 13M Apr 5 00:41 postgresql12-server-12.2-1PGDG.rhel7.x86_64.rpm [root@centos7-6 pg-rpm]#
安装
[root@centos7-6 pg-rpm]# rpm -ivh postgresql12-libs-12.2-1PGDG.rhel7.x86_64.rpm [root@centos7-6 pg-rpm]# rpm -ivh postgresql12-12.2-1PGDG.rhel7.x86_64.rpm [root@centos7-6 pg-rpm]# rpm -ivh postgresql12-server-12.2-1PGDG.rhel7.x86_64.rpm
初始化数据库并设置自启动
/usr/pgsql-12/bin/postgresql-12-setup initdb systemctl enable postgresql-12 systemctl start postgresql-12
systemctl status postgresql-12
也可以使用PG自带的工具pg_ctl
配置环境变量
-bash-4.2$ pwd /var/lib/pgsql -bash-4.2$ -bash-4.2$ vi .bash_profile
#追加内容 export PATH=$PATH:/usr/pgsql-12/bin
-bash-4.2$ source .bash_profile
[root@centos7-6 ~]# su - postgres -bash-4.2$ pg_ctl stop -bash-4.2$ pg_ctl start -bash-4.2$ pg_ctl status
CentOS7.6上安装postgreSQL
标签:png x86_64 stat start org 装包 var mct --
本文系统来源:https://www.cnblogs.com/connected/p/12635653.html
内容总结
以上是互联网集市为您收集整理的CentOS7.6上安装postgreSQL全部内容,希望文章能够帮你解决CentOS7.6上安装postgreSQL所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。