在CentOS 6.3 安装postgresql9.5
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了在CentOS 6.3 安装postgresql9.5,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3080字,纯文字阅读大概需要5分钟。
内容图文
![在CentOS 6.3 安装postgresql9.5](/upload/InfoBanner/zyjiaocheng/481/a61f807e39d042c6b119c848dd8e7ce0.jpg)
CentOS release 6.3 (Final)
安装时如果提示yum源不对,注意调整rpm源如下:
[root@mdw yum.repos.d]# cat pgdg-95-redhat.repo
[pgdg95]
name=PostgreSQL 9.5 $releasever - $basearch
baseurl=https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-$releasever-$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-95
[pgdg95-source]
name=PostgreSQL 9.5 $releasever - $basearch - Source
failovermethod=priority
baseurl=https://download.postgresql.org/pub/repos/yum/srpms/9.5/redhat/rhel-$releasever-$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-95
二、开始安装:
yum install postgresql95-devel-9.5.5-1PGDG.rhel6.x86_64.rpm
yum install postgresql95-server postgresql95-contrib
三、初始化数据库:
mkdir -p /data/postgres/pgsql/data
chown -R postgres.postgres /data/postgres/
(1)先切换到postgres用户
[root@mdw yum.repos.d]# su - postgres
(2)如果初始化成功,会有如下提示:
-bash-4.1$ /usr/pgsql-9.5/bin/initdb -D /data/postgres/pgsql/data
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /data/postgres/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
creating template1 database in /data/postgres/pgsql/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects‘ descriptions ... ok
creating collations ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
loading PL/pgSQL server-side language ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
syncing data to disk ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
/usr/pgsql-9.5/bin/pg_ctl -D /data/postgres/pgsql/data -l logfile start
-bash-4.1$
四、启动数据库:
$ /usr/pgsql-9.5/bin/pg_ctl -D /data/postgres/pgsql/data -l /tmp/postrest.log start
server starting
五、创建db
createdb mysql2gp_sy
六、登录数据库:
$ psql -h 127.0.0.1 -d mysql2gp_sy -U postgres
psql (9.5.6)
Type "help" for help.
mysql2gp_sy=#
至此,安装成功。
在CentOS 6.3 安装postgresql9.5
标签:aries ons create x86 系统 文件 creating rip and
本文系统来源:http://www.cnblogs.com/tonnyChen/p/6782761.html
内容总结
以上是互联网集市为您收集整理的在CentOS 6.3 安装postgresql9.5全部内容,希望文章能够帮你解决在CentOS 6.3 安装postgresql9.5所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。