This repository was archived by the owner on Jul 16, 2021. It is now read-only.

Description
Developing with docker-compose got the following error:
$ docker-compose exec app php artisan migrate --seed --path=/database/migrations/legacy
Migration table created successfully.
Loading stored database schema: /var/www/html/database/schema/mysql-schema.dump
Symfony\Component\Process\Exception\ProcessFailedException
The command "mysql --user="${:LARAVEL_LOAD_USER}" --password="${:LARAVEL_LOAD_PASSWORD}" --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}" --database="${:LARAVEL_LOAD_DATABASE}" < "${:LARAVEL_LOAD_PATH}"" failed.
Exit Code: 127(Command not found)
Working directory: /var/www/html
Output:
================
Error Output:
================
sh: 1: mysql: not found
at vendor/symfony/process/Process.php:267
263▕ */
264▕ public function mustRun(callable $callback = null, array $env = []): self
265▕ {
266▕ if (0 !== $this->run($callback, $env)) {
➜ 267▕ throw new ProcessFailedException($this);
268▕ }
269▕
270▕ return $this;
271▕ }
+19 vendor frames
20 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
That happens because the app container does not have mysql server, which is run in another container.
Desired change:
- run
php artisan migrate and it works independent of the machine having mysql installed or not.