0

I was searching solution of this problem but i did not find exactly the same which I have. This is all error message:

Illuminate\Database\QueryException : could not find driver (SQL: select * from information_schema.tables where table_schema = forge and table_name = migrations)

at /mnt/c/xampp/htdocs/blog/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664 660| // If an exception occurs when attempting to run a query, we'll format the error 661| // message to include the bindings with SQL, which will make this exception a 662| // lot more helpful to the developer instead of just the database's errors. 663| catch (Exception $e) {

664| throw new QueryException( 665| $query, $this->prepareBindings($bindings), $e 666| ); 667| } 668|

Exception trace:

1 PDOException::("could not find driver") /mnt/c/xampp/htdocs/blog/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70

2 PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=forge", "forge", "", []) /mnt/c/xampp/htdocs/blog/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70

Please use the argument -v to see more details.

I tried make command sudo apt-get install php7.0-pgsqland other from this topic Laravel: Error [PDOException]: Could not Find Driver in PostgreSQL and still does not work.

1 Answer 1

0

You need to install pdo and mysql driver

sudo apt-get install php{V}-mysql sudo apt-get install pdo-mysql 

replace v with your php version. If your using PostgreSQL, please make sure to change connection in config/database.php or in the .env file

Sign up to request clarification or add additional context in comments.

12 Comments

I did this and I received for php5-mysql Reading package lists... Done Building dependency tree Reading state information... Done Package php5-mysql is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'php5-mysql' has no installation candidate and for pdo-mysql Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package pdo-mysql
sudo apt-get install php-mysql
The same I got message Reading package lists... Done php-mysql 0 upgraded, 1 newly installed, 0 to remove and 207 not upgraded. Need to get 5,958 B of archives. After this operation, 12.3 kB of additional disk space will be used. Err:1 ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 php-mysql all 2:7.2+68+ubuntu16.04.1+deb.sury.org+1 Bad header line Bad header data E: Failed to fetch ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php-defaults/… Bad header line Bad header data
which version of php are you using?
PHP 7.1.25-1+ubuntu16.04.1+deb.sury.org+1
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.