could not find driver (SQL: select * from information_schema.tables where table_schema = oliver and

在使用Laravel框架进行数据库迁移时遇到错误,显示'IlluminateDatabaseQueryException',提示找不到数据库驱动。错误堆栈显示在尝试执行SQL查询时出现问题。解决方案是通过运行'yum install php-mysqlnd'来安装PHP的MySQL驱动。安装完成后,问题应得到解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

centos

laravel

在数据库迁移的时候,

php artisan migrate

 Illuminate\Database\QueryException 

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

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
    667|         // If an exception occurs when attempting to run a query, we'll format the error
    668|         // message to include the bindings with SQL, which will make this exception a
    669|         // lot more helpful to the developer instead of just the database's errors.
    670|         catch (Exception $e) {
  > 671|             throw new QueryException(
    672|                 $query, $this->prepareBindings($bindings), $e
    673|             );
    674|         }
    675|

      +33 vendor frames 
  34  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

显示没有驱动

安装php的mysql相关库即可

yum install php-mysqlnd

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值