沃梦达 / 编程问答 / php问题 / 正文

Laravel 5 错误 SQLSTATE[HY000] [1045] 用户 'homestead'@'localhost' 的访问被拒绝(使用密码:YES)

Laravel 5 error SQLSTATE[HY000] [1045] Access denied for user #39;homestead#39;@#39;localhost#39; (using password: YES)(Laravel 5 错误 SQLSTATE[HY000] [1045] 用户 homestead@localhost 的访问被拒绝(使用密码:YES))

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

问题描述

我已成功安装 Laravel 5,并将配置目录中 database.php 文件中的 MySQL 凭据更改为'

I have installed Laravel 5 successfully and changed MySQL credentials in database.php file in config directory to '

mysql' => [
            'driver'    => 'mysql',
            'host'      => env('DB_HOST', 'localhost'),
            'database'  => env('DB_DATABASE', 'wdcollect'),
            'username'  => env('DB_USERNAME', 'root'),
            'password'  => env('DB_PASSWORD', ''),
            'charset'   => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix'    => '',
            'strict'    => false,
        ],

我不想使用宅基地,我已将 .env 文件更改为

I don't want to use homestead and I have changed .env file to

APP_ENV=local
APP_DEBUG=true
APP_KEY=apLIzEMOgtc5BUxdT9WRLSvAoIIWO87N

DB_HOST=localhost
DB_DATABASE=wdcollect
DB_USERNAME=root
DB_PASSWORD=

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null

我不明白为什么它说'homestead'@'localhost'的访问被拒绝

I don't understand that why it's saying that access denied for 'homestead'@'localhost'

推荐答案

现在可以了.我不得不重新启动服务器.谢谢

It's working now. I had to restart server. Thanks

这篇关于Laravel 5 错误 SQLSTATE[HY000] [1045] 用户 'homestead'@'localhost' 的访问被拒绝(使用密码:YES)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:Laravel 5 错误 SQLSTATE[HY000] [1045] 用户 'homestead'@'localhost' 的访问被拒绝(使用密码:YES)

基础教程推荐