0

I'm trying to run php artisan migrate but it's throwing error ( framework - Laravel, server - OpenServer )

Illuminate\Database\QueryException

could not find driver (SQL: select * from information_schema.tables where table_schema = laravel_blog and table_name = migrations and table_type = 'BASE TABLE')

enter image description here

MySQL driver information in .env:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel_blog
DB_USERNAME=root
DB_PASSWORD=
3
  • What OS are you using? This is telling you that you don't have a (my)SQL driver installed in PHP Commented Apr 11, 2020 at 8:21
  • Windows (10) - OS Commented Apr 11, 2020 at 8:23
  • There can be multiple reasons for this. Are you added credentials properly ? please check stackoverflow.com/questions/54124262/… also Commented Apr 11, 2020 at 8:26

2 Answers 2

1

In your php.ini configuration file simply uncomment (remove semicolon) the extension:

;extension=php_pdo_mysql.dll

And restart the server.

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

Comments

0

Following up from the other answer, if you uncommented

extension=php_pdo_mysql.dll

and it still doesn't work, uncomment the following also:

extension=pdo_sqlite

this is required if you use sqlite as your database instead of mysql

1 Comment

Welcome to Stack Overflow Amri! Although I appreciate you contributing an answer to this question it was clear in the question that they were trying to connect to a MySQL database. Please in future only add an answer if it is relevant to the question. I hope you have a great experience and thank you for helping our fellow developers!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.