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=
Community
  • 1
  • 1
  • What OS are you using? This is telling you that you don't have a (my)SQL driver installed in PHP – brombeer Apr 11 '20 at 08:21
  • Windows (10) - OS – Denis_54213213 Apr 11 '20 at 08:23
  • There can be multiple reasons for this. Are you added credentials properly ? please check https://stackoverflow.com/questions/54124262/how-to-fix-illuminate-database-queryexception-sqlstatehy000-1044-access-de also – SayAz Apr 11 '20 at 08:26

2 Answers2

1

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

;extension=php_pdo_mysql.dll

And restart the server.

Md Mahfuzur Rahman
  • 2,319
  • 2
  • 18
  • 28
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

Amri Ahmad
  • 15
  • 6
  • 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! – Dan Mason Apr 11 '20 at 18:31