I am using laravel 5.3
.
Recently I have setup my project on Ubuntu 14.04
and moved my project to LAMP
, before this it was on WAMP
.
My .env
file is as:
APP_ENV=local
APP_DEBUG=true
APP_KEY=somebase64key
DB_HOST=localhost
DB_DATABASE="local.d2d.com"
DB_USERNAME=d2d
DB_PASSWORD=
CACHE_DRIVER=file
SESSION_DRIVER=file
Yes, I have user d2d
and have all privileges on database local.d2d.com
in mysql
.
My config/database.php
is as:
<?php
return [
'fetch' => PDO::FETCH_CLASS,
'default' => 'mysql',
'connections' => [
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST'),
'database' => env('DB_DATABASE'),
'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
]
],
'migrations' => 'migrations',
'redis' => [
'cluster' => false,
'default' => [
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
]
]
];
While running php artisan migrate
, I am getting following error:
[Illuminate\Database\QueryException] SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (SQL: select * from information_schema.tables where table_schema = local.d2d.com and table_name = migrations)
[Doctrine\DBAL\Driver\PDOException] SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) [PDOException] SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)
You can see I am NOT USING root
user anywhere still I am facing this issue. Even in the connection error you may find the database is information_schema
instead of local.d2d.com
.
Yes, I have ran php artisan config:clear
, php artisan cache:clear
, php artisan view:clear
, php artisan clear-compiled
and php artisan optimize
many times.
Can anyone help?