QueryException SQLSTATE [HY000] [1045]用户'homestead'@'localhost'的访问被拒绝(使用密码:是) [英] QueryException SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)

查看:130
本文介绍了QueryException SQLSTATE [HY000] [1045]用户'homestead'@'localhost'的访问被拒绝(使用密码:是)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么会出现以下错误?

Why is the following error occurring?

QueryException SQLSTATE [HY000] [1045]拒绝用户访问 'homestead'@'localhost'(使用密码:是)

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文件中的信息后,您应该清除缓存.

You should clear the cache after changing info in the .env file.

运行以下命令:

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

这篇关于QueryException SQLSTATE [HY000] [1045]用户'homestead'@'localhost'的访问被拒绝(使用密码:是)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆