-2
I got database connection error in laravel latest version (5.2).
PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES) in Connector.php line 55 at PDO->__construct('mysql:host=127.0.0.1;port=3306;dbname=homestead', 'homestead', 'secret', array('0', '2', '0', false, false)) in Connector.php line 55
Here is .env file contents
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=simpletask
DB_USERNAME=root
DB_PASSWORD=''
also i am updating config.php file with the same as that of .env fileid't connect. I am a beginner of mysql server system . please help me how to connect step by step. mysql xampp
|
this question asked Apr 6 '16 at 12:31 Moniruzzaman Monir 1 The error message is quite self explanatory: eit
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'simpletask'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
'engine' => null,
]
php
mysql
pdo
|
this question asked May 5 '16 at 5:48
Blessan Kurien 696 8 26 Possible duplicate of
SQLSTATE[HY000] [2002] A connection attempt failed.. - When attempting to connect from Local to remote server –
e4c5 Jun 29 '16 at 3:24
|
1 Answers
1
if there is no password ,leave the password empty
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=simpletask
DB_USERNAME=root
DB_PASSWORD=
|
this answer answered May 5 '16 at 6:07
Moawia Meghari 120 7 Tried this,but didn't worked –
Blessan Kurien May 5 '16 at 6:09 witch program you use (xampp, wampp,mampp,...) ? –
Moawia Meghari May 5 '16 at 6:14 i am usingxampp:) –
Blessan Kurien May 5 '16 at 6:20 1 Problem solved i've restarted the dev server –
Blessan Kurien May 5 '16 at 6:41
|
in config directory to ' mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', 'localhost'), 'database' => env('DB_DATABASE', 'wdcollect'), 'username' => env('DB_USERNAME', 'root