Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
645 views
in Technique[技术] by (71.8m points)

php - Unable to use DatabaseMigrations in Laravel Dusk SQLSTATE[HY000] [2002] Connection refused

Full error:

SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `sessions` where `id` = NAaXsoKQ6Tw9qmLO4VOC2MFFjFaXAN6Cut6Df9wf limit 1)

I'm trying to do browser testing using laravel Dusk,

Here's the dusk ENV file

APP_NAME=Laravel
APP_ENV=local
APP_DEBUG=true
APP_URL=http://localhost:8000

LOG_CHANNEL=stack
LOG_LEVEL=debug

DB_CONNECTION=sqlite_dusk

in the database.php

'connections' => [

    'sqlite_dusk' => [
        'driver' => 'sqlite',
        'database' => database_path('dusk.sqlite'),
    ],

I've also have dusk.sqlite in root of my database folder


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try downgrading the chrome binaries.

Run:

php artisan dusk:chrome-driver 86

This issue is with Chrome 87.x binaries installed.

You must have used: php artisan dusk:chrome-driver --all


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...