Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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



412
Accepted
answer
edited Dec '15

Oops, i wrong in my services file

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

it should be :

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