I am trying to migrate migrations to MySQL database using php artisan migrate
in Laravel 5.2's Homestead on my local machine. I keep getting this error:
[PDOException]
SQLSTATE[HY000] [2002] No connection could be made because the target machine
actively refused it.
I can connect to the database just fine using MySQL workbench, but I want to use laravel's migration feature.
My database.php
looks like this:
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '192.168.10.10'),
'port' => env('DB_PORT', '33060'),
'database' => env('DB_DATABASE', 'laraveldb'),
'username' => env('DB_USERNAME', 'homestead'),
'password' => env('DB_PASSWORD', 'secret'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
'engine' => null,
],
Has anyone had this problem before?
'username' => env('DB_USERNAME', 'homestead'), 'password' => env('DB_PASSWORD', 'secret'),
. Are those theusername
andpassword
of database ? – Md Mahfuzur Rahman Apr 5 '16 at 11:44