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,并将配置目录中 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)
- 从 PHP 中的输入表单获取日期 2022-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- PHP Count 布尔数组中真值的数量 2021-01-01
- 正确分离 PHP 中的逻辑/样式 2021-01-01
- 如何定位 php.ini 文件 (xampp) 2022-01-01
- Mod使用GET变量将子域重写为PHP 2021-01-01
- SoapClient 设置自定义 HTTP Header 2021-01-01
- Laravel 仓库 2022-01-01
- 没有作曲家的 PSR4 自动加载 2022-01-01
- 带有通配符的 Laravel 验证器 2021-01-01