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

前端 未结 24 1600
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:52

    1. Edit the file .env in your laravel root directory. make looks as in below :

       DB_HOST=localhost
       DB_DATABASE=laravel
       DB_USERNAME=root
       DB_PASSWORD=your-root-pas
      
    2. Also create one database in phpmyadmin named, "laravel".

    3. Run below commands :

       php artisan cache:clear
       php artisan config:cache
       php artisan config:clear   
       php artisan migrate
      

    It worked for me, XAMPP with Apache and MySQL.

提交回复
热议问题