惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News | PayPal Newsroom
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News: Ask HN
Hacker News: Ask HN
H
Hacker News: Front Page
Apple Machine Learning Research
Apple Machine Learning Research
TaoSecurity Blog
TaoSecurity Blog
Help Net Security
Help Net Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
人人都是产品经理
人人都是产品经理
博客园 - 三生石上(FineUI控件)
Security Latest
Security Latest
Cloudbric
Cloudbric
WordPress大学
WordPress大学
S
SegmentFault 最新的问题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Know Your Adversary
Know Your Adversary
A
Arctic Wolf
L
LangChain Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
The GitHub Blog
The GitHub Blog
P
Proofpoint News Feed
W
WeLiveSecurity
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
M
MIT News - Artificial intelligence
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Cloudflare Blog
小众软件
小众软件
NISL@THU
NISL@THU
云风的 BLOG
云风的 BLOG
P
Privacy & Cybersecurity Law Blog
S
Security @ Cisco Blogs
博客园 - 【当耐特】
I
InfoQ
Vercel News
Vercel News
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
P
Proofpoint News Feed
O
OpenAI News
Google DeepMind News
Google DeepMind News
N
News and Events Feed by Topic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
K
Kaspersky official blog
T
Threat Research - Cisco Blogs
量子位
宝玉的分享
宝玉的分享

博客园 - 黄尚

年前辞职,年后找工作 airport 抓包 配置ssh使用socks代理 配置git使用socks5代理 bash 相关的一些小代码片断 MacOS changed System Integrity Protection status CMakeLists.txt for nginx 构建最小的docker容器 centos 7 挂载大硬盘 rsync 通过 ssh 上传文件 php-fpm 在centos 7下的安装配置 在osx下通过vmware无GUI方式运行centos 7 ruby on rails 在centos 7下的安装配置 Mariadb 在centos 7下的安装配置 osx 编译安装配置 ruby on rails tls/ssl证书生成和格式转换 nginx相关的一些记录 用systemd脚本自动启动node js程序 SSH Tunneling
PostgreSQL 在centos 7下的安装配置
黄尚 · 2015-08-24 · via 博客园 - 黄尚

安装postgresql:

sudo yum install postgresql-server

 初始化数据库:

sudo postgresql-setup initdb

启动数据库:

sudo systemctl start postgresql

设置为自动启动:

sudo systemctl enable postgresql

 允许外网访问数据库:

sudo vi /var/lib/pgsql/data/postgresql.conf

找到:
listen_addresses = 'localhost'
改成:
listen_addresses = '*'

保存退出
:wq

sudo vi /var/lib/pgsql/data/pg_hba.conf
在文件最后加上一行:
 host    all             all             192.168.1.200/32        md5

保存退出
:wq

 切换到postgres用户:

启动PostgresSQL控制台:

给postgres用户设置个密码:

说明:postgres用户有点类似mysql的root用户,拥有所有权限,一般开发的时候最好建个新的用户。

为数据库创建新用户:

CREATE USER username WITH PASSWORD 'password';

创建新数据库:

CREATE DATABASE database_name OWNER username;

设置权限:

GRANT ALL PRIVILEGES ON DATABASE database_name to username;

搞定这些之后,就可以用navicat连接来管理它了,对于开发人员来说,用postgresql和用mysql没什么大的区别。