linux 系统
[ : ~ 18:02:58 ]$ cat /etc/issue
CentOS release 6.7 (Final)
Kernel \r on an \m
安装pg 9.4.8 yum 源 pgdg-redhat94-9.4-1.noarch.rpm
rpm -ivh pgdg-redhat94-9.4-1.noarch.rpm
安装pg
yum install postgresql94 postgresql94-server --disablerepo=* --enablerepo=pgdg94
修改service 带个9.4 看着烦
chkconfig --list
chkconfig --del postgresql-9.4
mv /etc/init.d/postgresql-9.4 /etc/init.d/postgres
chkconfig --add postgres
修改hba 配置 支持用户名 密码方式登录 否则
psql: FATAL: Peer authentication failed for user "z"
psql: FATAL: Peer authentication failed for user "zhouyf"
vi /var/lib/pgsql/9.4/data/pg_hba.conf
This file controls:
-
Which hosts are allowed to connect
-
How clients are authenticated
-
Which PostgreSQL user names they can use
-
Which databases they can access
#添加两行 注释掉一行peer
# "local" is for Unix domain socket connections only
#local all all peer
local all all trust
host all all 127.0.0.1/32 trust
root启动pg server
service postgres start
连接
su - postgres
psql
\l
\conninfo
create user zhouyf password '123';
\q
psql -Uzhouyf -W
\conninfo
发现不带W 也能进入 还是socket 后面研究了再更新
阅读(1243) | 评论(0) | 转发(0) |