I was trying to execute a migrate command in laravel 5. But it shows a PDOException error. I changed database.php file to the following:
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
'engine' => null,
]
For PDOException: could not find driver for MySQL, and if it is Debian based OS,
sudo apt-get -y install php5-mysql
For more information read this post PDO Exception
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With