1. 修改PostgreSQL数据库默认用户postgres的密码
PostgreSQL数据库创建一个postgres用户作为数据库的管理员,密码随机,所以需要修改密码,方式如下:
步骤一:登录PostgreSQL
1
|
sudo
-u postgres psql
|
步骤二:修改登录PostgreSQL密码
1
|
ALTER USER postgres WITH PASSWORD
'postgres'
;
|
步骤三:退出PostgreSQL客户端
\q
2. django 连接postgres 失败
vim /var/lib/pgsql/9.6/data/pg_hba.conf
local all all md5 #认证方式改为 MD5
local replication postgres trust
host replication postgres 127.0.0.1/32 trust
host replication postgres ::1/128 trust