CentOS6安装Postgresql96并测试

本文涉及的产品
云原生数据库 PolarDB MySQL 版,Serverless 5000PCU 100GB
简介: 参考官网地址: https://www.postgresql.org/download/linux/redhat/之后更改postgresql.

参考官网地址:

https://www.postgresql.org/download/linux/redhat/

之后更改postgresql.conf

#vim /var/lib/pgsql/9.6/data/postgresql.conf  
listen_address = '*' 
port = 5432  

更改pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            ident
host    all             all             0.0.0.0/0               md5

# IPv6 local connections:
host    all             all             ::1/128                 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            ident
#host    replication     postgres        ::1/128                 ident
local   replication     postgres                                trust
host    replication     postgres        127.0.0.1/32            trust
host    replication     postgres        ::1/128                 trust

之后发现如下, 连不上

psql -U postgres -h xxxx

原因是没有设置postgres的密码,于是

#psql
postgres=# ALTER USER postgres WITH PASSWORD 'postgres';
ALTER ROLE

重启服务搞定


Postgresql 常用数据类型总结:

https://www.cnblogs.com/stephen-liu74/archive/2012/04/30/2293602.html

这里写图片描述

这里写图片描述


新建一个数据库:

postgres=# CREATE DATABASE real_estate_trans
postgres-# ;

新建一个schema:

CREATE SCHEMA IF NOT EXISTS hangzhou;

创建一张表:

CREATE TABLE hangzhou.trans_daily_info (  
    trans_date DATE NOT NULL,  
    downtown_new_trans SMALLINT NOT NULL,
    downtown_new_vol INTEGER NOT NULL,
    xiaoshan_new_trans SMALLINT NOT NULL,
    xiaoshan_new_vol INTEGER NOT NULL,
    yuhang_new_trans SMALLINT NOT NULL,
    yuhang_new_vol INTEGER NOT NULL,
    fuyang_new_trans SMALLINT NOT NULL,
    fuyang_new_vol INTEGER NOT NULL,
    djd_new_trans SMALLINT NOT NULL,
    djd_new_vol INTEGER NOT NULL,
    urban_new_daily_trans SMALLINT NOT NULL,
    urban_new_daily_vol INTEGER NOT NULL,
    other4county_new_qty SMALLINT NOT NULL,
    other4country_new_vol INTEGER NOT NULL,
    downtown_old_qty SMALLINT NOT NULL,
    PRIMARY KEY (trans_date)  
);
相关实践学习
使用PolarDB和ECS搭建门户网站
本场景主要介绍基于PolarDB和ECS实现搭建门户网站。
阿里云数据库产品家族及特性
阿里云智能数据库产品团队一直致力于不断健全产品体系,提升产品性能,打磨产品功能,从而帮助客户实现更加极致的弹性能力、具备更强的扩展能力、并利用云设施进一步降低企业成本。以云原生+分布式为核心技术抓手,打造以自研的在线事务型(OLTP)数据库Polar DB和在线分析型(OLAP)数据库Analytic DB为代表的新一代企业级云原生数据库产品体系, 结合NoSQL数据库、数据库生态工具、云原生智能化数据库管控平台,为阿里巴巴经济体以及各个行业的企业客户和开发者提供从公共云到混合云再到私有云的完整解决方案,提供基于云基础设施进行数据从处理、到存储、再到计算与分析的一体化解决方案。本节课带你了解阿里云数据库产品家族及特性。
目录
相关文章
|
8天前
|
前端开发 jenkins 持续交付
新的centos7.9安装docker版本的jenkins2.436.1最新版本-前端项目发布(五)
新的centos7.9安装docker版本的jenkins2.436.1最新版本-前端项目发布(五)
31 1
|
7天前
|
安全 关系型数据库 数据库
PostGreSQL安装压缩包格式
PostGreSQL安装压缩包格式
|
8天前
|
SQL 缓存 关系型数据库
postgresql的安装和使用
postgresql的安装和使用
29 0
|
2天前
|
网络协议 Java Linux
CentOS上安装运行XWiKi
CentOS上安装运行XWiKi
8 0
|
2天前
|
Java Linux
CentOS上安装openjdk
CentOS上安装openjdk
9 0
|
3天前
|
Java 应用服务中间件 Linux
Centos7 安装JDK和Tomcat
Centos7 安装JDK和Tomcat
18 0
|
3天前
|
运维 网络协议 Linux
2024年最全CentOS8 Consul微服务架构安装(1)_agent(1),Linux运维开发面试
2024年最全CentOS8 Consul微服务架构安装(1)_agent(1),Linux运维开发面试
|
5天前
|
安全 关系型数据库 MySQL
解决centos7.0安装mysql后出现access defind for user@'localhost'的错误
在使用yum 安装完mariadb, mariadb-server, mariadb-devel后
9 0
|
6天前
|
Linux 网络安全 数据安全/隐私保护
centos7安装gitlab-ce社区版全过程,详细到爆炸,这些面试官常问的开发面试题你都掌握好了吗
centos7安装gitlab-ce社区版全过程,详细到爆炸,这些面试官常问的开发面试题你都掌握好了吗
|
8天前
|
NoSQL Linux Redis
在CentOS上安装和配置Redis
在CentOS上安装和配置Redis
89 0

热门文章

最新文章