Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5 PDOException Could Not Find Driver

I have a problem using Laravel 5. When I run "php aritsan migrate", I got this error

************************************** *     Application In Production!     * **************************************  Do you really wish to run this command? [y/N] y  [PDOException] could not find driver 

I could run the application, but when database connection needed, I got this error

PDOException in Connector.php line 55: could not find driver in Connector.php line 55 at PDO->__construct('mysql:host=localhost;dbname=mydb', 'root', '', array('0', '2', '0', false, false)) in Connector.php line 55 at Connector->createConnection('mysql:host=localhost;dbname=mydb', array('driver' => 'mysql', 'host' => 'localhost', 'database' => 'mydb', 'username' => 'root', 'password' => '', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'name' => 'mysql'), array('0', '2', '0', false, false)) in MySqlConnector.php line 22 

How to fix it?

like image 425
ZZZ Avatar asked Feb 06 '16 11:02

ZZZ


1 Answers

Same thing happend to me after upgrading distro.

Running sudo apt-get install php7.0-mysql fixed it for me.

like image 148
knalj Avatar answered Sep 30 '22 11:09

knalj