Estou tentando fazer conexão na base de dados pgsql pelo Laravel 5.1 mas está aparecendo um erro:
PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)
--
in Connector.php line 55 at PDO->__construct('mysql:host=127.0.0.1;dbname=carros', 'root', 'senha_do_root', array('0', '2', '0', false, '0')) in Connector.php line 55 at Connector->createConnection('mysql:host=127.0.0.1;dbname=carros', array('driver' => 'mysql', 'host' => '127.0.0.1', 'database' => 'carros', 'username' => 'root', 'password' => 'senha_do_root', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'name' => 'mysql'), array('0', '2', '0', false, '0')) in MySqlConnector.php line 22 at MySqlConnector->connect(array('driver' => 'mysql', 'host' => '127.0.0.1', 'database' => 'carros', 'username' => 'root', 'password' => 'senha_do_root', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'name' => 'mysql')) in ConnectionFactory.php line 60 at ConnectionFactory->createSingleConnection(array('driver' => 'mysql', 'host' => '127.0.0.1', 'database' => 'carros', 'username' => 'root', 'password' => 'senha_do_root', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'name' => 'mysql')) in ConnectionFactory.php line 49 at ConnectionFactory->make(array('driver' => 'mysql', 'host' => '127.0.0.1', 'database' => 'carros', 'username' => 'root', 'password' => 'senha_do_root', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false), 'mysql') in DatabaseManager.php line 175
Meu arquivo .env está assim:
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=carros
DB_USERNAME=root
DB_PASSWORD=senha_do_root
E meu arquivo database está assim:
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => '5432',
'database' => env('DB_DATABASE', 'carros'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'senha_do_root'),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
],