[英]PDOException SQLSTATE[28000] [1045] Access denied for user 'homestead'@'localhost'
I am new in Laravel 5.2. 我是Laravel 5.2的新手。
I am getting following error: 我收到以下错误:
[PDOException]
SQLSTATE[28000] [1045] Access denied for user 'homestead'@'localhost' (usin
g password: YES)
While I execute following command: 当我执行以下命令时:
php artisan migrate
I am running application using vagrant on windows PC. 我正在使用Windows PC上的vagrant运行应用程序。 Please let me know why I am getting above error.
请让我知道为什么我遇到上述错误。
您必须在.env文件中设置数据库连接。
You are getting above error because on your .env file. 您在.env文件中遇到上述错误。 If you open that from your project base directory then you will following default configuration:
如果从项目基目录打开它,那么您将遵循默认配置:
DB_CONNECTION=mysql
DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
Just change above values according to your development environment. 只需根据您的开发环境更改上述值即可。 Try again, Hopefully that would resolve your issue.
再试一次,希望能解决您的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.