Fastest Web Hosting

laravel 5 database problem

0 votes
asked Nov 5, 2016 in Laravel by punnet (400 points)

I have installed laravel 5 successfully by using this command:

composer create-project laravel/laravel test-laravel-5-project dev-develop --prefer-dist

Then filled up the form and submitted the data and this is the error which I got:

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

How can I fix those issues?

1 Answer

+1 vote
answered Nov 7, 2016 by anonymous

Edit in .eve file

DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

and database.php

// instead of this block
    'mysql' => [
        'driver'    => 'mysql',
        'host'      => env('DB_HOST', 'localhost'),
        'database'  => env('DB_DATABASE', 'your database name'),
        'username'  => env('DB_USERNAME', 'your database username'),
        'password'  => env('DB_PASSWORD', 'your database password'),
        'charset'   => 'utf8',
        'collation' => 'utf8_unicode_ci',
        'prefix'    => '',
        'strict'    => false,
    ],

    // use this one

    'mysql' => [
        'driver'    => 'mysql',
        'host'      => 'localhost',
        'database'  => 'your database name',
        'username'  => 'your database username',
        'password'  => 'your database password',
        'charset'   => 'utf8',
        'collation' => 'utf8_unicode_ci',
        'prefix'    => '',
        'strict'    => false,
]

Job Board

TechnicalSharp is a technical community of developers where they are sharing their knowledge and solutions and against it they are getting the score point which help them to make profile strong which is under eyes on MNC's
...