1

"SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = homestead and table_name = migrations)"

database.php

'connections' => [

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

migrations

public function up(){
        Schema::create('cards', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id');
            $table->string('title');
            $table->timestamps();
        });
    }
Bibek
  • 13
  • 1
  • 2
  • 7

1 Answers1

1

Edit your .env file:

DB_CONNECTION=sqlite

and

config/database.php file:

replace

'database' => env('DB_DATABASE', database_path('database.sqlite')),

with

'database' => database_path('database.sqlite'),

From https://laracasts.com/discuss/channels/laravel/pdoexception-sqlstatehy000-2002-connection-refused

RyanNerd
  • 3,059
  • 1
  • 22
  • 28