在线精品99_中国九九盗摄偷拍偷看_91免费版在线观看_91.app_91高清视频在线_99热最新网站

Linux下PostgreSQL如何源码安装

141次阅读
没有评论

共计 3616 个字符,预计需要花费 10 分钟才能阅读完成。

这篇文章将为大家详细讲解有关 Linux 下 PostgreSQL 如何源码安装,丸趣 TV 小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

1、首先安装依赖包,避免在安装过程中出现问题

shell  yum install gcc gcc-c++ automake autoconf libtool make
shell  yum install readline-devel
shell  yum install zlib-devel

2、创建 postgre 用户及用户组

shell  groupadd postgre
shell  useradd -g postgre postgre 
shell  passwd postgre # 修改密码
shell  id postgre
uid=500(postgre) gid=501(postgre)  组 =501(postgre)

3、编译安装 postgre

shell  tar zxvf postgresql-9.3.6.tar.gz
shell  cd postgresql-9.3.6
shell  ./configure --prefix=/db/pgsql
shell  make   make install 
PostgreSQL installation complete.

4、设置数据库目录权限并初始化数据库

shell  mkdir -p /db/pgsql/data
shell  chown -R postgre.postgre /db/pgsql/
shell  cp contrib/start-scripts/linux /etc/rc.d/init.d/postgresql
shell  su - postgre
#  初始化数据库
shell  /db/pgsql/bin/initdb -D /db/pgsql/data/
The files belonging to this database system will be owned by user  postgre .
This user must also own the server process.
The database cluster will be initialized with locale  zh_CN.UTF-8 .
The default database encoding has accordingly been set to  UTF8 .
initdb: could not find suitable text search configuration for locale  zh_CN.UTF-8 
The default text search configuration will be set to  simple .
Data page checksums are disabled.
fixing permissions on existing directory /db/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
creating configuration files ... ok
creating template1 database in /db/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:
 /db/pgsql/bin/postgres -D /db/pgsql/data/
 /db/pgsql/bin/pg_ctl -D /db/pgsql/data/ -l logfile start

5、设置环境变量

shell  vi .bash_profile
==================================================================
PATH=$PATH:$HOME/bin:/db/pgsql/bin
export PGDATA=/db/pgsql/data
export PGHOME=/db/pgsql
export LANG=zh_CN.UTF-8
export PGPORT=5432
export PATH
==================================================================
shell  source .bash_profile

6、开启 postgre 服务

shell  pg_ctl -D /db/pgsql/data/ -l /db/pgsql/log/logfile start 
server starting
shell  tail -f /db/pgsql/logfile
LOG: database system was shut down at 2015-04-20 17:59:36 CST
LOG: database system is ready to accept connections
LOG: autovacuum launcher started

7、测试连接数据库

shell  createdb mydb
shell  psql -h 127.0.0.1 -p 5432 -U postgre -W mydb
Password for user postgre: 
psql (9.3.6)
Type  help  for help.
mydb=# 
#  显示当前数据库
mydb=# \l
 List of databases
 Name | Owner | Encoding | Collate | Ctype | Access privileges 
-----------+---------+----------+-------------+-------------+---------------------
 mydb | postgre | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 | 
 postgres | postgre | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 | 
 template0 | postgre | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 | =c/postgre +
 | | | | | postgre=CTc/postgre
 template1 | postgre | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 | =c/postgre +
 | | | | | postgre=CTc/postgre
(4 rows)
#  退出命令行
mydb=# \q

关于“Linux 下 PostgreSQL 如何源码安装”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-27发表,共计3616字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)
主站蜘蛛池模板: 比比资源先锋影音网 | 女人扒开裤子让男人捅 | 18禁无码永久免费无限制网站 | 日日夜夜操操 | 深夜a级毛片 | 欧美真人作爱免费视频 | 骚片av蜜桃精品一区 | 国产精品99r8在线观看 | 国产成人18黄禁网站免费观看 | 亚洲不卡中文字幕 | 欧洲美熟女乱av亚洲一区 | 国产午夜成人久久无码一区二区 | 激情综合丁香 | 亚洲精品二区 | 中国a级毛片免费观看 | 国内精品自产拍在线观看 | 亚洲一区二区三区在线播放 | 人妻少妇精品久久久久久 | 四虎永久在线精品免费播放 | 香蕉伊大在线中字色中文 | 风流老熟女一区二区三区 | 国产一区视频在线播放 | 大胆gogo高清在线观看 | 欧美成人免费观看bbb | 国产成人综合精品 | 中文字幕无码不卡一区二区三区 | 国产精品久久久久激情影院 | 免费的拍拍视频在线观看 | 亚洲国产情侣偷自在线二页 | 人妻少妇久久久久久97人妻 | 99久久久免费精品免费 | 91国在线国内在线播放 | 免费观看又污又黄的网站 | 亚洲熟女乱色综合亚洲小说 | 亚洲精品一区二区国产精华液 | a毛片毛费观看 | 刮伦真实在线永久视频 | 日韩中文字幕不卡 | 狠狠综合欧美综合欧美色 | 蜜臀国产在线视频 | 无人区码一码二码w358cc |