Sid*_*idC 6 permissions postgresql django 14.04
我正在运行带有 Postgres 9.3、Python 3.0 和 Django 1.7 的 Ubuntu 14.04。当我尝试从 PyDev 调试我的应用程序时,我收到以下信息:
Creating test database for alias 'default'...
Got an error creating the test database: permission denied to create database
Run Code Online (Sandbox Code Playgroud)
奇怪的是,我无法使用最初创建的密码从命令行登录用户 postgres。我昨晚重置了一次,仍然无法这样做。
我pg_hba.conf
的如下:
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5
local all postgres peer
local all stbiuser md5
local all all md5
Run Code Online (Sandbox Code Playgroud)
我settings.py
的如下:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'db',
'USER': 'user',
'PASSWORD': 'mypass',
'Host':'127.0.0.1',
'PORT':'5432'
}
}
Run Code Online (Sandbox Code Playgroud)
如何修复权限被拒绝消息?是否还需要任何设置修改?
小智 8
您的用户可能无权创建数据库、打开终端并以 postgress 身份登录 postgress 并运行以下命令
ALTER USER user CREATEDB;
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
7669 次 |
最近记录: |