doulaopu2343 2015-12-21 18:30 采纳率: 100%
浏览 50

Doctrine控制台错误SQLSTATE [7006] [7]致命:用户“SYSTEMUSER”的身份验证失败

I created a composer project with PHP 5.6.16, laravel/framework 5.1 and doctrine/orm 2.5.

Installed Postgresql 9.4 and Postgres Admim 3.

Create a admin role, a test database with a test table. Granted all permissions on database and tables to admin role.

$host   = 'localhost';
$dbname = 'test';
$dbuser = 'admin';
$dbpass = 'secret';

$connection = new PDO("pgsql:dbname=$dbname;host=$host", $dbuser, $dbpass);
if ($connection) {
   $connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
   $collection = $connection->query('select * from test');
   foreach ($collection as $row) {
      var_dump($row);

All works fine.

I created a cli-config.php file that loads the database config file from laraval framework with the same setup, creates a EntityManager through a service provider and returns a console runner:

$provider      = new App\Providers\DoctrineServiceProvider($app);
$entityManager = $provider->getEntityManager();

return \Doctrine\ORM\Tools\Console\ConsoleRunner::createHelperSet($entityManager);

I'm sure the EntityManager was created and i'm sure the correct database configuration was used.

When I run "vendor/bin/doctrine orm:validate-schema", i got an excetion:

[Doctrine\DBAL\Exception\ConnectionException] An exception occured in driver: SQLSTATE[08006] [7] FATAL: Ident authentication failed for user "SYSTEMUSER"

[Doctrine\DBAL\Driver\PDOException] SQLSTATE[08006] [7] FATAL: Ident authentication failed for user "SYSTEMUSER"

[PDOException] SQLSTATE[08006] [7] FATAL: Ident authentication failed for user "SYSTEMUSER"

Not that the user on exception message is different from the role used. The SYSTEMUSER is equals to my Ubuntu user.

I changed the dbuser to postgres and i got the same exception.

Anyone have clues about this?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度