
[英]Laravel 5 error SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)
[英]“SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)”
我使用过Laravel 5.7。 我仅在生产中遇到此错误,我的应用程序在本地运行良好。 我尝试更改:
'主机'=> env('DB_HOST','127.0.0.1')
至
config / database.php中的'host'=> env('DB_HOST','localhost')
只需设置正确的数据库凭据:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE= // Your Database Name
DB_USERNAME= // Yout Database Username
DB_PASSWORD= // Your Database Password
.env
编辑完成后,请在您的终端中输入以下命令以清除缓存: php artisan config:cache
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.