0

I was able to successfully create migrations from Xampp. However when i installed Homestead(vagrant,Virtual Box) and try to associate it with a database and run migrations i am facing

##[PDOException] SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'##

I have literally tried many configurations for .env file and config/database file , none seems to be working. .ENV File

APP_ENV=local
APP_KEY=base64:AxtpwFxTGQ3tkumIu1nkzswrTbuI37BigLGn3meRC6M=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=lara56
DB_USERNAME=root
DB_PASSWORD=

My config/database file

'connections' => [

        'sqlite' => [
            'driver' => 'sqlite',
            'database' => env('DB_DATABASE', database_path('database.sqlite')),
            'prefix' => '',
        ],

        'mysql' => [
            'driver' => 'mysql',
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'lara56'),
            'username' => env('DB_USERNAME', 'root'),
            'password' => env('DB_PASSWORD', ''),
            'charset' => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix' => '',
            'strict' => true,
            'engine' => null,
        ],
Arun3x3
  • 193
  • 1
  • 7
  • 17
  • MYSQL 5.7 USERS: You will not be able to use 'root' user anymore. See https://stackoverflow.com/a/36909790/1696153 – Katie Mar 09 '19 at 01:41

2 Answers2

-1

You should use homestead as username and database since it's the default configuration. Or you can ssh into homestead and create the username.

Pawan Kumar
  • 594
  • 4
  • 18
-1

just fixed this issue by stopping any MySQL services that were running in my task manager Services bar after I had stopped Xampp