Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

artisan migration error “Class 'Doctrine\\DBAL\\Driver\\PDOMySql\\Driver' not found”

When trying to run a migration I get the error Artisan migration

[Symfony\Component\Debug\Exception\FatalThrowableError]

Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found

i already installed doctrine/dbal using

composer require doctrine/dbal

and on my composer.json already had

doctrine/dbal": "^3.0"

but i still got this error

like image 839
Alghany Jagad Avatar asked Nov 17 '20 05:11

Alghany Jagad


2 Answers

This new version is having this issue. a workaround for that can be:

  1. change version to "doctrine/dbal": "^2.12.1" in composer.json file
  2. run composer update
like image 102
Md Somir Avatar answered Sep 19 '22 12:09

Md Somir


"composer require doctrine/dbal ^2.12.1"

In updated versions of doctrine/dbl, Integration with PDO has been reworked. The php_pdo extension is no longer a hard dependency of the doctrine/dbal package. The PDO API is not longer the standard for DBAL APIs.

  • The following database platforms are no longer supported: ( Drizzle, MariaDB 10.0 and older, Microsoft Azure, PostgreSQL 9.3 and older, SQL Anywhere, SQL Server 2008 and older.)

  • The following drivers are no longer supported: ( pdo_ibm, sasql. )

  • Passing a PDO instance initialized outside of the DBAL is no longer supported.

Here is the reference document (https://github.com/doctrine/dbal/releases)

like image 44
husnain zafar Avatar answered Sep 17 '22 12:09

husnain zafar