R
Railway•3y ago
Josh Larson

Can I install `mysql-client` for a Laravel app without using a custom Dockerfile?

Pretty standard Laravel app without a Dockerfile, and I updated the build command to include php artisan db:migrate --force. Here's what I see in the build log:
#15 9.908 Creating migration table ...................................... 54.27ms DONE
#15 9.963
#15 9.971 INFO Loading stored database schemas.
#15 9.971
#15 9.971 database/schema/mysql-schema.dump ............................. 25.98ms FAIL
#15 10.05
#15 10.05 Symfony\Component\Process\Exception\ProcessFailedException
#15 10.05
#15 10.05 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.
#15 10.05
#15 10.05 Exit Code: 127(Command not found)
#15 10.05
#15 10.05 Working directory: /app
#15 10.05
#15 10.05 Output:
#15 10.05 ================
#15 10.05
#15 10.05
#15 10.05 Error Output:
#15 10.05 ================
#15 10.05 sh: 1: mysql: not found
#15 9.908 Creating migration table ...................................... 54.27ms DONE
#15 9.963
#15 9.971 INFO Loading stored database schemas.
#15 9.971
#15 9.971 database/schema/mysql-schema.dump ............................. 25.98ms FAIL
#15 10.05
#15 10.05 Symfony\Component\Process\Exception\ProcessFailedException
#15 10.05
#15 10.05 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.
#15 10.05
#15 10.05 Exit Code: 127(Command not found)
#15 10.05
#15 10.05 Working directory: /app
#15 10.05
#15 10.05 Output:
#15 10.05 ================
#15 10.05
#15 10.05
#15 10.05 Error Output:
#15 10.05 ================
#15 10.05 sh: 1: mysql: not found
I've also updated my NIXPACKS_PKGS to include libmysqlclient 🤔 Any thoughts?
4 Replies
njoguamos
njoguamos•3y ago
Try NIXPACKS_APT_PKGS=mysql-client if NIXPACKS_PKGS did not work for you.
Josh Larson
Josh Larson•3y ago
ah ha - NIXPACKS_APT_PKGS=default-mysql-client ended up doing the trick! thank you!
Josh Larson
Josh Larson•3y ago
dropped a feature request in here for future people: https://github.com/railwayapp/nixpacks/issues/610
GitHub
Support MySQL for PHP Laravel apps · Issue #610 · railwayapp/nixpac...
Feature request It would be sweet if Nixpacks could automatically install the default-mysql-client apt package when a Laravel/PHP app is detected. Motivation Currently, in order to get my Laravel a...
njoguamos
njoguamos•3y ago
Great. I am glad it worked out.
Want results from more Discord servers?
Add your server