【发布时间】:2016-02-03 10:46:14
【问题描述】:
我用的是 Yii2,数据库连接
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'pgsql:host=localhost;dbname=data-storage',
'username' => 'data-storage',
'password' => '',
'charset' => 'utf8',
]
我的数据库没有密码。我收到一个错误:SQLSTATE[08006] [7] fe_sendauth:没有提供密码。 如果我使用一些密码(只是假的,正如我所提到的,我没有密码),我会得到:password authentication failed for user "data-storage"
在 pg_hba.conf 我有我的域的记录:host all all 172.28.3.70/32 trust
这对 PgAdmin 很有效。
【问题讨论】:
标签: postgresql yii2