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.

3
  • Possible duplicate of Laravel 5 PDOException Could Not Find Driver Commented Apr 16, 2019 at 14:48
  • You're missing MySQL for PDO. How did you install PHP on your Linux OS? Using Ondrej Sury's repository or? Commented Apr 16, 2019 at 15:05
  • By running 'sudo apt-get install php7.2-mysql' , problem was solved. Thank you. @Script47 Commented Apr 16, 2019 at 15:06

2 Answers 2

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).

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

1 Comment

Yes I have run 'sudo apt-get install php7.2-mysql' and everything is working fine.
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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.