And I feel stupid.
Artisan migrate only works via SSH to vagrant/code.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Brand new to Laravel and trying to set up homestead. Long and short of it:
php artisan migrate
Leads to
exception 'PDOException' with message 'SQLSTATE[28000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)'
SSH in an mysql -u homestead -p works just fine?
See many many instances of this question; Changing host to 127.0.0.1:33060 makes no difference. Putting credentials directly into database.php rather than .env makes no difference.
database.php
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
.env
DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
Please or to participate in this conversation.