Home >Database >Mysql Tutorial >Laravel 5 Migration Error: How to Fix 'PDOException: could not find driver'?
Issue:
When attempting to run "php artisan migrate" in Laravel 5, users may encounter an error:
PDOException: could not find driver
Background:
This error typically occurs when there's a missing or improperly installed database driver, preventing PHP from connecting to the specified database.
Solution:
To resolve this issue, install the appropriate database driver using the appropriate package manager. For Ubuntu-based systems, running the following command should fix it:
sudo apt-get install php7.0-mysql
Ensure you replace "php7.0-mysql" with the correct package name corresponding to your PHP version and database type.
The above is the detailed content of Laravel 5 Migration Error: How to Fix 'PDOException: could not find driver'?. For more information, please follow other related articles on the PHP Chinese website!