0

I'm completely beginner using laravel and also with databases, so don't be harsh.

I followed the guide: https://www.youtube.com/watch?v=Tsr3NgoExfo&index=4&list=PL55RiY5tL51qUXDyBqx0mKVOhLNFwwxvH (might be useful!)

and after command "php artisan migrate" I got error SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES).

I'm using XAMPP. I'm not sure how I'm getting this error and why. Maybe someone could take a look on the guide video (only 6mins) and see what the problem is in my configuration?

.env

APP_ENV=local
APP_DEBUG=true
APP_KEY=**

DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

database.php

 'mysql' => [
        'driver'    => 'mysql',
        'host'      => env('DB_HOST', 'localhost'),
        'database'  => env('DB_DATABASE', 'forge'),
        'username'  => env('DB_USERNAME', 'forge'),
        'password'  => env('DB_PASSWORD', ''),
        'charset'   => 'utf8',
        'collation' => 'utf8_unicode_ci',
        'prefix'    => '',
        'strict'    => false,
    ],

I feel really stuck here. Tried different things and solutions (around forums) and still couldn't find anything that works! Any help would be a blast.

  • Presumably you've checked that the name and password of the user are correct? – Lex Webb Dec 08 '16 at 17:09
  • The DB username/password must be wrong – Nandan Bhat Dec 08 '16 at 17:10
  • as @Nandan said.. you probably have the wrong credentials. Try to login to your DB via the command line to ensure your credentials are correct and it's not something with your code. – Jordan Soltman Dec 08 '16 at 17:19
  • The credentials you use are set up to work with the Homestead virtual machine development environment. I strongly suggest you use it (docs on Laravels web site). If you want to continue using XAMPP then you need to either create a database/user in your MYSQL server with the credentials above, or change the credentials to some that exist already – JimL Dec 08 '16 at 17:25

0 Answers0