在网络上,数据库与应用程序连接。但是,在命令行上会出现以下错误:
Illuminate\Database\QueryException : could not find driver (SQL: select * from information_schema.tables where table_schema = public and table_name = migrations and table_type = 'BASE TABLE')
at C:\wamp64\www\hrmnxt\vendor\laravel\framework\src\Illuminate\Database\Connection.php:669
// If an exception occurs when attempting to run a query, we'll format the error
// message to include the bindings with SQL, which will make this exception a
// lot more helpful to the developer instead of just the database's errors.
catch (Exception $e) {
throw new QueryException(
$query, $this->prepareBindings($bindings), $e
);
}
Exception trace:
1 PDOException::("could not find driver")
C:\wamp64\www\hrmnxt\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70
2 PDO::__construct("pgsql:host=localhost;dbname=hrmnxt;port=5432;sslmode=prefer", "postgres", "secret", [])
C:\wamp64\www\hrmnxt\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70
Laravel:6
Postgresql 9.6
我从未遇到过这样的问题,但是也许您应该首先检查是否满足所有要求(laravel安装) PHP模块的激活方式如[https://laravel.com/docs/7.x/installation)具体来说就是这个:
PDO PHP扩展
此链接可以帮助您调试:Laravel: PDOException: could not find driver
如果不起作用,请告诉我,我会帮助您。