1

When i am running php artisan migrate there is error like this:

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

I have already changed my

AppServiceProvider.php

file. This could not solve that. And I could't find another solution. Please help me solve this problem.

P.S My OS is Linux. I tried to run exactly the same project on Windows, and it is working fine.

  • Possible duplicate of [Laravel 5 PDOException Could Not Find Driver](https://stackoverflow.com/questions/35240414/laravel-5-pdoexception-could-not-find-driver) – Script47 Apr 16 '19 at 14:48
  • You're missing MySQL for PDO. How did you install PHP on your Linux OS? Using Ondrej Sury's repository or? – Mjh Apr 16 '19 at 15:05
  • By running 'sudo apt-get install php7.2-mysql' , problem was solved. Thank you. @Script47 – Khurshid Yakubov Apr 16 '19 at 15:06

2 Answers2

1

You might be missing the mysql extension for php.

In Linux, the install command is 'apt-get install phpX.X-mysql' where the X.X is your php version ('php -v' to find our which version you have).

Krieger
  • 26
  • 4
0

This is general error showing that your system doesn't have database extension (postgres or MySQL whichever you are using) for please try to install it.

svikramjeet
  • 1,779
  • 13
  • 27