postgresql-9.2 install
时间:2019-09-06
本文章向大家介绍postgresql-9.2 install,主要包括postgresql-9.2 install使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
[root@weblogic opt]# groupadd postgresql
[root@weblogic opt]# useradd -g postgresql postgres
[root@weblogic opt]# passwd postgres
[root@weblogic opt]# chmod +x postgresql-9.2.19-1-linux-x64.run
[root@weblogic opt]# ll postgresql-9.2.19-1-linux-x64.run
-rwxr-xr-x 1 root root 39523652 Sep 6 01:12 postgresql-9.2.19-1-linux-x64.run
安装
[root@weblogic opt]# ./postgresql-9.2.19-1-linux-x64.run
next---next
配置环境变量
/etc/profile
export LD_LIBRARY_PATH=/opt/PostgreSQL/9.2/lib:$LD_LIBRARY_PATH
export PATH=/opt/PostgreSQL/9.2/bin:$PATH
export PGDATA=/opt/PostgreSQL/9.2/data
source /etc/profile
su - postgres
cd /opt/PostgreSQL/9.2/bin
初始化数据库
[postgres@weblogic bin]$ ./initdb -D /opt/PostgreSQL/9.2/data
initdb: invalid locale name ""
initdb: invalid locale name ""
initdb: invalid locale name ""
initdb: invalid locale name ""
initdb: invalid locale name ""
initdb: invalid locale name ""
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
initdb: invalid locale name ""
initdb: invalid locale name ""
initdb: invalid locale name ""
initdb: invalid locale name ""
initdb: invalid locale name ""
initdb: invalid locale name ""
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 "C".
The default database encoding has accordingly been set to "SQL_ASCII".
The default text search configuration will be set to "english".
The default database encoding has accordingly been set to "SQL_ASCII".
The default text search configuration will be set to "english".
fixing permissions on existing directory /opt/PostgreSQL/9.2/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in /opt/PostgreSQL/9.2/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating collations ... locale: Cannot set LC_MESSAGES to default locale: No such file or directory
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
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in /opt/PostgreSQL/9.2/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating collations ... locale: Cannot set LC_MESSAGES to default locale: No such file or directory
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
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.
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:
./postgres -D /opt/PostgreSQL/9.2/data
or
./pg_ctl -D /opt/PostgreSQL/9.2/data -l logfile start
or
./pg_ctl -D /opt/PostgreSQL/9.2/data -l logfile start
[postgres@weblogic bin]$
启动PG
[postgres@weblogic bin]$ ./postgres -i -D /opt/PostgreSQL/9.2/data &
[1] 18363
[postgres@weblogic bin]$ LOG: database system was shut down at 2019-09-06 01:59:02 PDT
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
[1] 18363
[postgres@weblogic bin]$ LOG: database system was shut down at 2019-09-06 01:59:02 PDT
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
[postgres@weblogic bin]$ lsof -i:5432
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
postgres 18363 postgres 3u IPv4 439718 0t0 TCP *:postgres (LISTEN)
postgres 18363 postgres 4u IPv6 439719 0t0 TCP *:postgres (LISTEN)
[postgres@weblogic bin]$
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
postgres 18363 postgres 3u IPv4 439718 0t0 TCP *:postgres (LISTEN)
postgres 18363 postgres 4u IPv6 439719 0t0 TCP *:postgres (LISTEN)
[postgres@weblogic bin]$
登录PG
[postgres@weblogic bin]$ psql
psql.bin (9.2.19)
Type "help" for help.
psql.bin (9.2.19)
Type "help" for help.
postgres=# \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------+-----------
postgres | Superuser, Create role, Create DB, Replication | {}
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------+-----------
postgres | Superuser, Create role, Create DB, Replication | {}
postgres=#
PG 版本查看:
postgres=# select version();
version
----------------------------------------------------------------------------------------------------------------
PostgreSQL 9.2.19 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55), 64-bit
(1 row)
version
----------------------------------------------------------------------------------------------------------------
PostgreSQL 9.2.19 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55), 64-bit
(1 row)
postgres=#
原文地址:https://www.cnblogs.com/vzhangxk/p/11476928.html
- 主题与皮肤
- 在C++中模拟JAVA内部类的方法
- 母版页
- 微信公众平台接口报警功能 响应出问题随时发现
- WPF 获取本地IP地址
- 消灭假新闻:使用Scikit-Learn检测虚假新闻
- WPF 跳动的文字
- Sql批量修改帝国cms文章发布时间(需unix时间,否则会变为1970-01-01)
- socket 通信 多线程调用窗体(委托)的几个知识点,记录在案,以备查阅
- 微信公众平台改版 终于支持图文消息链接了
- 机器学习黑客系列:模型比较与选择
- asp.net :使用jquery 的ajax +WebService+json 实现无刷新去后台值
- 用A标签实现页面内容定位 点击链接跳到具体位置
- Seq2seq模型的一个变种网络:Pointer Network的简单介绍
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- 手把手教你实现xxl-job分布式任务调度平台搭建
- 直播短视频源码,动态需要用到点击图片展示预览效果的功能
- Docker 详细部署不香吗?
- 【41期】盘点那些必问的数据结构算法题之链表
- 那个男人 他带着Vue3来了~
- 小书MybatisPlus第9篇-常用字段默认值自动填充
- 【42期】盘点那些必问的数据结构算法题之二叉堆
- 小书MybatisPlus第8篇-逻辑删除实现及API细节精讲
- 小书MybatisPlus第7篇-代码生成器的原理精讲及使用方法
- 小书MybatisPlus第6篇-主键生成策略精讲
- Spring Security OAuth2之resource_id配置与验证
- 了解红黑树的起源,理解红黑树的本质
- 在java中进行日期时间比较的4种方法
- 【crossbeam系列】4 crossbeam-channel:加强版channel
- 不想得手指关节炎?帮你提炼IDEA常用代码补全操作