" SQLSTATE [HY000] [2002] 拒绝连接(SQL:select * from information_schema.tables 其中table_schema = homestead和table_name = migrations)"
database.php
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
],
迁移
public function up(){
Schema::create('cards', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->string('title');
$table->timestamps();
});
}
答案 0 :(得分:0)
编辑.env文件:
DB_CONNECTION=sqlite
和
config/database.php
档案:
替换
'database' => env('DB_DATABASE', database_path('database.sqlite')),
与
'database' => database_path('database.sqlite'),
来自https://laracasts.com/discuss/channels/laravel/pdoexception-sqlstatehy000-2002-connection-refused