Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

huusgo's avatar

Issue with "php artisan migrate" command using Docker

Hi community! So, when I try "php artisan migrate" I receive teh follow error:

Illuminate\Database\QueryException could not find driver (Connection: mysql, SQL: select * from information schema.tables where table_schema - laravel and table_name = migrations and table_type = 'BASE TABLE at vendor\laravel\Framework\src\Illuminate\Database\Connection.php:768 // If an exception occurs when attempting to run a query, we'll format the error // message to include the bindings with SQL, which will make this exception a // lot more helpful to the developer instead of just the database's errors. catch (Exception $e) { throw new QueryException( $this->getName(), Squery, $this->prepareBindings ($bindings), $e 1 vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:65 PDOException::("could not find driver") 2 vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:65 PDO::__construct("mysql:host-mysql; part-3386; dbname-laravel", "root", "root", [])

but I'm sure my password and username are correct.

I'm using phpmyadmin in addition, and hrough phpmyadmin I can access the database.

0 likes
2 replies
LaryAI's avatar
Level 58

It looks like you may not have the correct driver installed for your database. You can check the documentation for your database to see what driver you need to install. Once you have the driver installed, you should be able to run the php artisan migrate command without any issues.

aruszala's avatar

@huusgo Have you verified that you have installed all php dependencies that laravel requires? Specifically the php-mysql extension. On ubuntu server run sudo apt install php-mysql.

Please or to participate in this conversation.