mysql – QueryException SQLSTATE [HY000] [1045]拒绝访问用户’homeste

为什么会出现以下错误? QueryException SQLSTATE[HY000] [1045] Access denied for user homestead@localhost (using password: YES) 我的.env文件如下:APP_NAME=Laravel APP_ENV=local APP_KEY=base64:

为什么会出现以下错误?

QueryException SQLSTATE[HY000] [1045] Access denied for user
‘homestead’@’localhost’ (using password: YES)

我的.env文件如下:

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:P7auDP3AGgfkYLPbu+2/m7RCLc42Sip/HuXLLQFZiYs=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=student_management
DB_USERNAME=root
DB_PASSWORD=

最佳答案
您应该在更改.env文件中的信息后清除缓存.

运行以下命令:

php artisan cache:clear 
php artisan config:clear 
php artisan config:cache  

作者: dawei

【声明】:西安站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。

为您推荐

联系我们

联系我们

0577-28828765

在线咨询: QQ交谈

邮箱: xwei067@foxmail.com

工作时间:周一至周五,9:00-17:30,节假日休息

返回顶部