Artisan migrate could not find driver

if you've installed php and mysql in your linux machine, php needs php-mysql extention to communicate with mysql. so make sure you've also installed this extention using:

sudo yum install php-mysql in redhat based machines.

and

sudo apt-get install php-mysql in debian machines.


In your php.ini configuration file simply uncomment the extension:

;extension=php_pdo_mysql.dll

(You can find your php.ini file in the php folder where your stack server is installed.)

If you're on Windows make it: extension=php_pdo_mysql.dll

If you're on Linux make it: extension=pdo_mysql.so

And do a quick server restart.

If this isn't working for you, you may need to install pdo_mysql extension into your php library.


We have solved the same error by following the below steps.

linux command for this type of error occurred then, first of all, check your php.ini file

If your php.ini file exists then in configuration file simply uncomment the extension:

;extension=php_pdo_mysql.dll 

Else follow below steps

step1:php -v

step2: Install php mysql extension

php 7.0 sudo apt-get install php7.0-mysql

php 7.1 sudo apt-get install php7.1-mysql

php 7.2 sudo apt-get install php7.2-mysql

php 7.3 sudo apt-get install php7.3-mysql

step3: service apache2 restart

step4: php artisan migrate

Tags:

Php

Laravel