Hello Guys, How are you all? Hope You all Are Fine. Today I am facing the following error Laravel PDOException could not find driver in laravel. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
How Laravel PDOException could not find driver Error Occurs ?
I have Connected my MySQL database with Laravel and now I am facing the following error.
php artisan migrate:refresh --seed
[Illuminate\Database\QueryException]
could not find driver (SQL: select * from usa_client where type = 'table ' and name = migrations)
[Doctrine\DBAL\Driver\PDOException]
could not find driver
[PDOException]
could not find driver
How To Solve Laravel PDOException could not find driver Error ?
- How To Solve Laravel PDOException could not find driver Error?
To Solve Laravel PDOException could not find driver Error Here you have a missing dependency If you can, run. composer update composer require doctrine/dbal second solution is First of all, run this command sudo apt-get update If you are using Mysql Database then run this command sudo apt-get install php-mysql and If you are using PostgreSQL Database then run this command sudo apt-get install php-pgsql Then run php artisan migrate
- Laravel PDOException could not find driver
To Solve Laravel PDOException could not find driver Error Here you have a missing dependency If you can, run. composer update composer require doctrine/dbal second solution is First of all, run this command sudo apt-get update If you are using Mysql Database then run this command sudo apt-get install php-mysql and If you are using PostgreSQL Database then run this command sudo apt-get install php-pgsql Then run php artisan migrate
Solution 1: missing dependency
Here you have a missing dependency If you can, run.
composer update
composer require doctrine/dbal
Solution 2: Edit your php.ini
Here you should install PDO on your server. And Edit your php.ini Find and uncomment the following line (remove the ;
character)
;extension=pdo_mysql.so //uncomment this line just remove ;
Then, restart your Apache server
Solution 3: Run sudo apt-get install php7.0-mysql
Running sudo apt-get install php7.0-mysql
fixed it for me.
Solution 4: Install database first
First of all, run this command
sudo apt-get update
If you are using Mysql Database
sudo apt-get install php-mysql
If you are using PostgreSQL Database
sudo apt-get install php-pgsql
Then
php artisan migrate
Summary
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read
thank you so much. The Solution 2 is the best option for me. thanks.
solution 2 work for me too. Thx a lot <3
solution 2 work. Thank u so much!!
It’s my Pleasure to Help You fadilmalik. Thank You For Your Valuable words.