Laravel 5 error SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)

前端 未结 24 1591
Happy的楠姐
Happy的楠姐 2021-02-03 19:23

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

mysql\' => [
            \'driver\'           


        
24条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-03 19:45

    None of these worked for me when I deployed my website online on shared hosting, below is what I did that worked.

    In the .env file, I changed

    DB_HOST=127.0.0.1
    

    to

    DB_HOST=localhost
    

    and viola, it worked well as expected.

提交回复
热议问题