Best to use the IP so it's connectible from both remote CLI and your local machine
'host' => '192.168.10.10',
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I had a working Homestead environment for a few weeks, but it seems that the mysql connection suddenly stopped working. This is the Laravel QueryException I get:
SQLSTATE[42S02]: Base table or view not found
It seems that Laravel can connect to MySQL and the Homestead database, but can't find the table. This part is correct, the table does indeed not exist, so I tried to use artisan migrate to create the different tables, with the following result:
SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it.
I can ssh into vagrant, connect to MySQL and show the different databases and tables.
I tried vagrant destroy -> vagrant up, even downloaded the homestead box again trying to create a fresh environment, but nothing seems to fix this problem.
My database.php configuration:
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost:33060',
'database' => 'homestead',
'username' => 'homestead',
'password' => 'secret',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
anyone have an idea or advice?
Please or to participate in this conversation.