2016-11-07 32 views
0

這是我Scrutinizer實例配置:Scrutinizer - PSQL - 訪問與Postgres的用戶拒絕

build: 
dependencies: 
    before: 
     - psql -c 'CREATE DATABASE db_name WITH OWNER scrutinizer;' 
     - psql -c "ALTER ROLE postgres WITH PASSWORD 'postgres'" 
     - psql -c 'GRANT ALL PRIVILEGES ON DATABASE "db_name" to postgres' 
     - cp .env.example .env 
project_setup: 
    override: 
     - true 
environment: 
    php: 
     version: 7.0.6 
    node: 4.0 
    variables: 
     APP_KEY: 'app_key' 
     BUGSNAG_API_KEY: 'test' 
tests: 
    override: 
     - 
      command: vendor/bin/phpunit -v --debug --coverage-clover=my-coverage-file --configuration phpunit.xml 
      coverage: 
       file: my-coverage-file 
       format: php-clover 

檢查: PHP: code_rating:真 重複:真

,但我不能訪問PSQL與用戶postgres,任何想法?

Access denied for user 'postgres'@'localhost' (using password: YES) 
+0

這看起來像一個'mysql'錯誤消息。看起來你的PHP代碼連接到MySQL而不是Postgres –

+0

@a_horse_with_no_name好吧,讓我檢查 – bizzr3

+0

@a_horse_with_no_name非常感謝你是對的。 – bizzr3

回答

0

分辨率:

SC不能確定在這種情況下,.envphpunit.xml,所以我在我的網絡測試案例,將其指定setup方法:

putenv('DB_DATABASE=db_name'); 
    putenv('DB_USERNAME=postgres'); 
    putenv('DB_PASSWORD=postgres'); 
    putenv('DB_CONNECTION=pgsql'); 
    putenv('DB_PORT=5432'); 

最重要的變量是DB_CONNECTION