GodziLaravel's avatar

pgsql Migrate : could not find driver

Hello ,

I try to run migration :

 php artisan migrate

But I receive this error :

 Illuminate\Database\QueryException  : could not find driver (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE')

  at /data/www/*****.******.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664
    660|         // If an exception occurs when attempting to run a query, we'll format the error
    661|         // message to include the bindings with SQL, which will make this exception a
    662|         // lot more helpful to the developer instead of just the database's errors.
    663|         catch (Exception $e) {
  > 664|             throw new QueryException(
    665|                 $query, $this->prepareBindings($bindings), $e
    666|             );
    667|         }
    668|

  Exception trace:

  1   PDOException::("could not find driver")
      *********.******.com/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70

  2   PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=laravel", "root", "", [])
      /data/www/****.****.com/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70

  Please use the argument -v to see more details.

In phpinfo() :

PDO
PDO support	enabled
PDO drivers	pgsql
pdo_pgsql
PDO Driver for PostgreSQL	enabled
PostgreSQL(libpq) Version	10.8 (Ubuntu 10.8-0ubuntu0.18.04.1)
Module version	7.2.19-0ubuntu0.18.04.1
Revision	$Id: 9c5f356c77143981d2e905e276e439501fe0f419 $
pgsql
PostgreSQL Support	enabled
PostgreSQL(libpq) Version	10.8 (Ubuntu 10.8-0ubuntu0.18.04.1)
PostgreSQL(libpq)	PostgreSQL 10.8 (Ubuntu 10.8-0ubuntu0.18.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0, 64-bit
Multibyte character support	enabled
SSL support	enabled
Active Persistent Links	0
Active Links	0

the .env :

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=irptest
DB_USERNAME=irptest
DB_PASSWORD=******

Please Help

0 likes
4 replies
GodziLaravel's avatar
GodziLaravel
OP
Best Answer
Level 8

I found it :

just by removing the store/cache content solved the problem

3 likes
seewhy's avatar

Hi, where can I find this store/cache

Please or to participate in this conversation.