permissions安装后出现Access denied for user 'forge'@'localhost' - 小众知识

permissions安装后出现Access denied for user 'forge'@'localhost'

2013年01月27日 14:18:05 苏内容
  标签: Access/MySQL

After upgrading to Laravel 5.2, none of my .env file values are being read. I followed the upgrade instructions; none of my config files were changed except auth.php. They were all working fine in previous version, 5.1.19

.env contains values such as



config/database.php contains

'mysql' => [

    'database' => env('DB_DATABASE', 'forge'),

    'username' => env('DB_USERNAME', 'forge'),


I get this error:

PDOException: SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO)

Clearly not pulling in my env config. This is affecting every single one of my config files, including third party such as bugsnag.

I also tried

php artisan config:clear

php artisan cache:clear


Trying php artisan tinker

>>> env('DB_DATABASE')

=> null

>>> getenv('DB_DATABASE')

=> false

>>> config('database.connections.mysql.database')

=> "forge"

>>> dd($_ENV)


I have tried installing a fresh copy of Laravel 5.2. I basically only copied in my "app" folder; no additional composer packages are included. Still having the same issue. I have other Laravel 5.2 projects on the same server that are working fine.


这是由于.env配置没有完全更新的缘故,使用以下命令即可,小众使用的是php artisan config:cache

php artisan config:cache 

php artisan config:clear 



2018-03-12 17:47:10

Useful advice. Thanks a lot. commander cialis sur le net <a href="">cialis generic</a> cialis 24 year old <a href=>cialis generic</a>


2018-03-13 11:11:18

Whoa all kinds of excellent tips. cialis and warfarin interaction <a href="">cialis generic</a> cialis funciona yahoo <a href=>buy cialis online</a>


2018-03-13 12:42:51

Appreciate it, Quite a lot of facts! forzest vs cialis <a href="">cialis generic</a> cialis vs viagra strength <a href=>cialis without a doctor prescription</a>


2018-03-14 05:30:39

Useful info. Thanks a lot. cialis hipertensao arterial <a href="">coupon cialis</a> cialis ja muut lääkkeet <a href=>generic cialis</a>