I set up homestead 2.0 on OSX host and using Sequel Pro.
I can do migration and confirm that data are migrated in Sequel Pro, so it looks like no problem about DB connection.
But once I try to fetch data from Laravel 4.2 app, it fails to retrieve data and get following error.
PDOException (2002)
SQLSTATE[HY000] [2002] Connection refused
Here is my mysql configuration.
'mysql' => array(
'driver' => 'mysql',
'host' => '127.0.0.1',
'port' => '33060',
'database' => 'homestead',
'username' => 'homestead',
'password' => 'secret',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => ''
Sequel pro setting is same above,
Name: 127.0.0.1
Host: 127.0.0.1
Username: homestead
Password: secret
Database:
Port: 33060
I tried change host name to 'localhost', homestead destroy and up, but No work. Why?? Any suggestion helps.
3306
, not33060
. You may have set up your system somewhat differently, though. Double check it.33060
is correct for Sequel because that's the port the homestead VM forwards to your host machine. For you App you need3306
because it runs inside the homestead VM.