Error in Laravel 5.0

2

I have a connection problem in Laravel when executing a query:

PDOException in Connector.php line 47:
SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)

File database.php:

'mysql' => [
    'driver'    => 'mysql',
    'host'      => env('DB_HOST', 'localhost'),
    'database'  => env('DB_DATABASE', 'estoque_laravel'),
    'username'  => env('DB_USERNAME', 'root'),
    'password'  => env('DB_PASSWORD', 'senhaacessodb'),
    'charset'   => 'utf8',
    'collation' => 'utf8_unicode_ci',
    'prefix'    => '',
    'strict'    => false,
],

I configured the same, and it gives this error when it accesses the page that executes the query.

    
asked by anonymous 10.01.2018 / 14:05

2 answers

3

You also need to change the .env file

APP_ENV=local
APP_DEBUG=true
APP_KEY=zLzPMzs5W4FNNuguTmbG8M0iFqhIVnsP

DB_HOST=localhost
DB_DATABASE=estoque_laravel
DB_USERNAME=root
DB_PASSWORD=senhaacessodb

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
    
10.01.2018 / 14:09
2

It does not set there. The settings are in the file .env , if it does not exist, rename the file .env.example to .env , inside the file it will contain the variables:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

Edit with your bank's current settings.

    
10.01.2018 / 14:09