I have installed Laravel 5 successfully and changed MySQL credentials in database.php file in config directory to \'
mysql\' => [
\'driver\'
If you are on MAMP
Check your port number as well generally it is
Host localhost
Port 8889
User root
Password root
Socket /Applications/MAMP/tmp/mysql/mysql.sock
I had the same problem, so I realized that the .env
file does not accept special characters, as my password has these characters, I added the password in the config/database.php
file.
Please update below file.
vendor - .env - on line#7
DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
Instead of homestead user your database, username and password. This should work for you.
It's working now. I had to restart server. Thanks
You do not need to set credentials in database.php file. It is enough if you have credentials in .env
If you are able to login to database directly then this password must work. It can be possible that you are having different environment than "local" which is defined in this file. Test is with "php artisan env"
I came up with this too... then I solve it by putting the database information directly in " database.php " In your case, I would change the information like this
mysql' => [
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'wdcollect',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
and don't forget to change your setting in XAMPP's config.inc
['auth_type'] = 'config';
['Servers'][$i]['user'] = 'root';
['Servers'][$i]['password'] = '';
['AllowNoPassword'] = true;