Search code examples
phplaravellumen

Django postgres database not connecting with Lumen


I am trying to connect django.db.backends.postgresql with my lumen application. But when I run the query then following error occured

could not find driver

Even I change the driver type from mysql to pgsql

My database connection

'ml_db' => [
            'driver' => 'django.db.backends.postgresql',
            'host' => env('ML_DB_HOST'),
            'port' => env('ML_DB_PORT'),
            'database' => env('ML_DB_NAME'),
            'username' => env('ML_DB_USER'),
            'password' => env('ML_DB_PASS'),
            'charset' => env('DB_CHARSET', 'utf8mb4'),
            'collation' => env('DB_COLLATION', 'utf8mb4_general_ci'),
            'prefix' => '',
            'timezone' => env('DB_TIMEZONE', '+00:00'),
            'strict' => false,
        ],

Is there any way to connect this database with my lumen application because I am using multiple databases in application.


Solution

  • The obvious answer here is, that you haven't installed the corresponding driver for your used dbms. So just install it.