Error when connecting with sqlite in the Laravel

Asked

Viewed 537 times

1

Internally everyone is working, migrations, tinker, sqlite3, but in the server application it always queries the mysql instead of the sqlite for all operations, ie he is using Connector.php instead of SQLiteConnector.php

there is another type of configuration to connect with sqlite?

.env

DB_CONNECTION=sqlite
#DB_HOST=127.0.0.1
#DB_PORT=3306
#DB_DATABASE=./database/database.sqlite
#DB_USERNAME=homestead
#DB_PASSWORD=secret

database php.

'connections' => [

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

Error

Queryexception SQLSTATE[HY000] [2002] No connection the p to be made because the target corner actively refused them.

  • put all the file database.php

  • "but in the server application" what are you running there? are there any env var already defined? Env vars has priority under the file . env

  • @Virgilionovic the file was not touched, only 'default' => env('DB_CONECNTION', 'sqlite') put in to see if it worked but it did not work

  • @gmsantos I don’t think I have because I started the server and nothing else, actually I will see what these env vars

  • post the exact error that is happening

  • edited the question

Show 1 more comment

1 answer

0


Error was silly, it simply had 2 started servers, not letting the settings be reflected in the application

Browser other questions tagged

You are not signed in. Login or sign up in order to post.