artisan migration error "Class 'Doctrine\\DBAL\\Driver\\PDOMySql\\Driver' not found",

The doctrine/dbal dependency needs to be added to your composer.json

composer require doctrine/dbal

For more information check laravel #Modifying Columns


In my case both composer install and composer install was not working giving a same error “Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found”,

The changes that i made to make this workable are given below

composer.json file changed

 "doctrine/dbal": "^3.0",

this changed with

"doctrine/dbal": "^2.0",

then run the command

composer update 

If you using doctrine 3, downgrade to "doctrine/dbal": "^2.10.3"(I don't know does laravel updated migration tools for doctrine 3. If do, you should update laravel tools). They renamed class and Doctrine\\DBAL\\Driver\\PDOMySql\\Driver not exists