Hi I still can't connect to database properly. When I type the commands below.
php artisan migrate
I got an error.
Here is my .env configuration
APP_ENV=local
APP_DEBUG=true
APP_KEY=ZbIZ4XfdWxzBbwvlQ6IPsplwfHUL4P5C
DB_HOST=localhost
DB_DATABASE=demol5
DB_USERNAME=root
DB_PASSWORD=
CACHE_DRIVER=file
SESSION_DRIVER=file
Anyone would like to help me with this please???
Thanks in advance.
In my database.php
'default' => 'mysql',
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => storage_path().'/database.sqlite',
'prefix' => '',
],
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'demol5'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
Still get an error
exception 'PDOException' with message 'SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)' in C
:\xampp\htdocs\laravel\demo-l5\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:47
Stack trace:
If you used php -S or php artisan serve, you need to restart your php built in server after updating .env file. To be sure, clear the cache.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community