Last active
October 18, 2017 16:21
-
-
Save codeachange/fee7ace063cfea950abe93c39b90a118 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 安装 | |
yum install postgresql-server postgresql-contrib | |
# 初始化 | |
postgresql-setup initdb | |
# ident 改为 md5,ident是使用系统账号验证; md5使用单独的数据库账号 | |
vi /var/lib/pgsql/data/pg_hba.conf | |
# 开机启动 | |
systemctl start postgresql | |
systemctl enable postgresql | |
# 进入命令行 | |
sudo -i -u postgres | |
psql | |
# type \q to quit | |
# 数据库操作(进入psql之后) | |
\l # 数据库列表 | |
create database db_name; # 创建数据库 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment