Laravel 获取以下错误时,Illumb\Database\QueryException找不到驱动程序(SQL:select count(*)作为“snippets”中的聚合)

Laravel 获取以下错误时,Illumb\Database\QueryException找不到驱动程序(SQL:select count(*)作为“snippets”中的聚合),laravel,Laravel,您好,我在laravel 6中遇到以下错误 Illuminate\Database\QueryException could not find driver (SQL: select count(*) as aggregate from `snippets`) 在Ubuntu中,您必须验证它使用的php版本是否与具有驱动程序的版本相同。 例如: 在public/info.php中创建info.php文件 看看php版本 为该版本安装mysql扩展,对于版本7.2,这应该是 sudo apt g

您好,我在laravel 6中遇到以下错误

Illuminate\Database\QueryException
could not find driver (SQL: select count(*) as aggregate from `snippets`)

在Ubuntu中,您必须验证它使用的php版本是否与具有驱动程序的版本相同。 例如:

  • 在public/info.php中创建info.php文件
  • 看看php版本
  • 为该版本安装mysql扩展,对于版本7.2,这应该是
    sudo apt get安装php7.2-mysql