A
A
Artem2020-01-20 21:19:32
css
Artem, 2020-01-20 21:19:32

How to fix laravel migration error?

when executing the php artisan migrate / php artisan migrate:refresh / php artisan migrate --seed command, an error appears:

Illuminate\Database\QueryException : could not find driver (SQL: select * from information_schema.tables where table_schema = app and table_name = migrations and table_type = 'BASE TABLE')
at C:\Users\Admin\OpenServer\OSPanel\domains\project \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|
Exception trace:
1 Doctrine\DBAL\Driver\PDOException::("could not find driver")
C:\Users\Admin\OpenServer\OSPanel\domains\project\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\ PDOConnection.php:31
2 PDOException::("could not find driver")
C:\Users\Admin\OpenServer\OSPanel\domains\project\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php: 27
Please use the argument -v to see more details.

laravel version: 6.11.0. problem even on a new project.
the .env file is configured correctly.
I am using openserver. reinstalling doesn't help.
as far as I understood: for some reason there is no driver (presumably PDOException). If there is a problem in the driver, you can tell me how to install it or register it. I've been trying to find a solution for 3 weeks now.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rustam Bainazarov, 2019-04-13
@Huf

A
Artem, 2020-03-21
@artem_atlas

I completely forgot about this question)
Adding helped

Schema::defaultStringLength(191);
in the boot function along the path app/providers/AppServiceProvider.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question