I am using Laravel 5 and I am having problems with my database conneciton:
Here is my database.php file:
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'my_scene'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'root'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
'engine' => null,
],
and here is my .env file:
DB_HOST=localhost
DB_DATABASE=my_scene
DB_USERNAME=root
DB_PASSWORD=null
however when i then run "php artisan migrate" i get the error
[PDOException] SQLSTATE[HY000] [1049] Unknown database 'my_scene'
I have tried php artisan cache:clear and config:cache and also reloaded my xampp controller but it has not worked.
any ideas?
DB_PASSWORD=
andenv('DB_PASSWORD', ''),
instead – fmgonzalezenv('DB_PASSWORD', null)
. I've never try with a null password. I thought it was empty, nor null. – fmgonzalez