We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Database Adapter use 'apache' user in PostgreSQL

Hi, I Try PostgerSQL for database in my new phalcon application. I was successfully create model from phalcon-dev tools, but when i show data in application, it show :

SQLSTATE[08006] [7] FATAL: password authentication failed for user "apache"

Why postgres user change it self to 'apache'?

this is my config database :

    'database' => array(
    'adapter'     => 'Postgresql',
    'host'        => '10.0.10.100',
    'username'    => 'postgres',
    'password'    => '',
    'dbname'      => 'company',
    'schema'      => 'people'
    ),

and here is in my service :

$di->set('db', function () use ($config) {
    return new Phalcon\Db\Adapter\Pdo\Postgresql(array(
                'host'     => $config->database->host,
                'username' => $config->database->username,
                'password' => $config->database->password,
                'dbname'   => $config->database->name,
                'schema'   => $config->database->schema
            ));
    //return new DbAdapter($config->toArray());
});

and another question is, can phalconphp use more than one schema in same database?

Thanks



1.2k
Accepted
answer
edited Dec '15

Oops, i wrong in my services file

'dbname' => $config->database->name

it should be :

'dbname' => $config->database->dbname