Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

odracir49's avatar

php artisan migrate access denied error on multiple database engines conflict

i´m getting the "Access denied for user 'username'@'localhost'" when using php artisan migrate, the thing is that i have those credentials on my homestead virtual machine mysql database, but it seems, artisan is using my pc´s mysql engine instead of the homestead´s. i want it to use the mysql engine on the virtual machine, not the PC´s mysql engine.

i double check de host, port, db name, user and pass that im using on my laravel project and the ones that are in my homestead´s mysql database engine, they´re correct the same.

please help.

0 likes
3 replies
Cronix's avatar
Cronix
Best Answer
Level 67

ssh into the homestead box and run it from there.

1 like
Cronix's avatar

No problem. If you use npm for compiling assets, it's usually best to run it the same way (ssh in) instead of from your host os.

1 like

Please or to participate in this conversation.