php - Laravel Illuminate\Database\QueryException:找不到驱动程序错误
问题描述
我将 Centos 7.7 与 PHP 7.2 一起使用,但是当我尝试使用 laravel 迁移 db 时会发生此错误。尝试了很多东西,但我无法解决这个问题。
Illuminate\Database\QueryException : could not find driver (SQL: select * from information_schema.tables where table_schema = forge and table_name = migrations and table_type = 'BASE TABLE')
at /var/www/vhosts/xxxx.com/saas.xxxx.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669
665| // If an exception occurs when attempting to run a query, we'll format the error
666| // message to include the bindings with SQL, which will make this exception a
667| // lot more helpful to the developer instead of just the database's errors.
668| catch (Exception $e) {
> 669| throw new QueryException(
670| $query, $this->prepareBindings($bindings), $e
671| );
672| }
673|
解决方案
你需要安装驱动试试这个
yum install -y --enablerepo=remi-php72 php-pdo_mysql
推荐阅读
- javascript - JavaScript 中 Fetching API 的输出意外结束
- c++ - 如何在模板类中调用函数对象,其中函数对象使用函数签名中的模板?
- javascript - 在 react native 中显示来自两个 json 文件的数据
- python - Find the smallest angle to include all points in a plane
- javascript - 为什么 jest.spyOn() 有时不适用于 Vue 组件的方法?
- css - Wordpress 帖子背景图像在类别页面上渗出
- c# - 如何处理通用存储库中的数据库事务?
- python - 多行的 itertools.product()
- user-interface - 如何根据项目索引更改gridView的高度??[颤动]
- perl - Perl 可以为未初始化的变量引用输出运行时错误,而不是静默退出脚本吗?