Homestead迁移mysql问题
我的 laravel 项目有问题。我只能通过 vagrant ssh 使用 php artisan migrate。 在正常终端中,它显示数据库连接错误。
这是我的环境文件
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=33060
DB_DATABASE=db_corsi
DB_USERNAME=homestead
DB_PASSWORD=secret
I've a problem with my laravel project. I can only use php artisan migrate by vagrant ssh.
In normal terminal it shows me a connection error with database.
This is my env file
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=33060
DB_DATABASE=db_corsi
DB_USERNAME=homestead
DB_PASSWORD=secret
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
更改端口
db_port = 33060
todb_port = 3306
change port
DB_PORT=33060
toDB_PORT=3306
我认为这不是问题,因为Vagrant是VM,因此您需要访问它可以运行工匠
I think this is not an issue because vagrant is VM so you need to access it to can run the artisan migrate