Access denied for user 'root'@'localhost' - Laravel

后端 未结 4 725
天命终不由人
天命终不由人 2021-01-05 00:21

I have an application with Laravel 4, that runs in localhost correctly, but when I uploaded it in my host I received the error .

app>config>database.php file is:

4条回答
  •  悲哀的现实
    2021-01-05 00:51

    This worked for me:

    php artisan config:clear
    

    Even though I changed the config details in the .env file, I was getting the Access denied error. Running the above command will clear configuration cache file and hence laravel will read the fresh data from the .env file.

提交回复
热议问题