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

被折叠的 条评论
为什么被折叠?



