更新时间:2021-08-04 21:23:50
有时,更改.env时,如果没有清除缓存或重新启动服务器,配置将不会刷新。
Sometimes when you change your .env, the configs don't refresh without clear cache or restarting the server.
错误消息是:
SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: YES)
尝试从缓存的 .env配置中获取信息,您应该尝试:
The database are trying to get the information from the "cached" .env configuration, you should try:
php artisan config:clear
如果无法解决,请重新启动服务器。
if not solve, restart your server.
config\database.php
并设置自己的凭据
'mysql' => [
'host' => '45.55.88.77',
'database' => 'prod',
'username' => 'forge',
'password' => '*********',
],
MySQL错误:#1045-用户' root' @' localhost'的访问被拒绝(使用密码:是)
Laravel 5 错误 SQLSTATE[HY000] [1045] 用户 'homestead'@'localhost' 的访问被拒绝(使用密码:YES)
[PDOException]-SQLSTATE [HY000] [1045]用户'root'@'ip'的访问被拒绝(使用密码:是)
SQLSTATE [HY000] [1045]用户'homestead'@'localhost'的访问被拒绝(使用密码:是)(SQL:从“表"中选择*)
lavaral 5错误{(SQLSTATE [HY000] [1045]用户'root'@'localhost'的访问被拒绝(使用密码:是)}
警告:mysqli_connect():(HY000 / 1045):访问被拒绝用户'用户名'@'localhost'(使用密码:是)