php - Laravel 5: Error: "Driver not found" while migrating the database(mysql) in laravel -


it's been around 5-6 hours since i've been trying use database in laravel 5.

i've gone through of videos , confused me lot.

i have created model , migration when try migrate gives me

[ pdoexception ] driver not found

i've made numerous changes .env , database.php nothing works.

i using laravel 5 xampp server.

kindly help

thank

.env file

app_env=local app_debug=true app_key=zzfvju3bkjxmlkbl5gsvj3ymkivhbgnq  db_connection=mysql db_host=localhost db_port=3306 db_database=medicaldb db_username=root db_password=  cache_driver=file session_driver=file queue_driver=sync  mail_driver=smtp mail_host=mailtrap.io mail_port=2525 mail_username=null mail_password=null mail_encryption=null 

database.php file

<?php  return [     'fetch' => pdo::fetch_class,     'default' => env('db_connection', 'mysql'),     'connections' => [          'sqlite' => [             'driver' => 'sqlite',             'database' => env('db_database', database_path('database.sqlite')),             'prefix' => '',         ],          'mysql' => [             'driver' => 'mysql',             'host' => env('db_host', 'localhost'),             'port' => env('db_port', '3306'),             'database' => env('db_database', 'medicaldb'),             'username' => env('db_username', 'root'),             'password' => env('db_password', ''),             'charset' => 'utf8',             'collation' => 'utf8_unicode_ci',             'prefix' => '',             'strict' => false,             'engine' => null,         ],          'pgsql' => [             'driver' => 'pgsql',             'host' => env('db_host', 'localhost'),             'port' => env('db_port', '5432'),             'database' => env('db_database', 'forge'),             'username' => env('db_username', 'forge'),             'password' => env('db_password', ''),             'charset' => 'utf8',             'prefix' => '',             'schema' => 'public',         ],      ],       'migrations' => 'migrations',     'redis' => [          'cluster' => false,          'default' => [             'host' => env('redis_host', 'localhost'),             'password' => env('redis_password', null),             'port' => env('redis_port', 6379),             'database' => 0,         ],      ],  ]; 

finally, @ last! worked!!

in php.ini file:

(semi-colon) ; works single-line comment in php.ini file. (semi-colon) added @ beginning of line - disables pdo mysql driver.

i needed remove semi-colon(;) enable mysql, beginning of line.


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -