Closed Ambroz91 closed 1 year ago
@Ambroz91 Sorry for the late reply...🙏
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')
This is an error when the pdo_mysql
extension is not present.
The pdo_mysql
extension module is installed at this time.
https://github.com/ucan-lab/docker-laravel/blob/main/infra/docker/php/Dockerfile#L31
This error probably occurred because php on the host OS was executed, not inside a Docker container. This error should not occur if you use the php command inside the container with the command below.
docker compose exec app php artisan migrate
As time has passed, this issue will be closed. Please re-open if you have any problems.
Hey. I'm having troble with an migration in docker. It sqys that there is a missing driver for mysql. Please help me with this.
First Error: php artisan migrate
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:793 789▕ // If an exception occurs when attempting to run a query, we'll format the error 790▕ // message to include the bindings with SQL, which will make this exception a 791▕ // lot more helpful to the developer instead of just the database's errors. 792▕ catch (Exception $e) { ➜ 793▕ throw new QueryException( 794▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
Second Error docker compose exec app php artisan migrate
Illuminate\Database\QueryException
SQLSTATE[HY000] [2002] Connection refused (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:793
789▕ // If an exception occurs when attempting to run a query, we'll format the error 790▕ // message to include the bindings with SQL, which will make this exception a
791▕ // lot more helpful to the developer instead of just the database's errors.
792▕ catch (Exception $e) {
➜ 793▕ throw new QueryException(
794▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
795▕ );
796▕ }
797▕ }
39 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))