Attempting to use mysqldump
patrgl
PROOP

9 months ago

Hey guys, I am attempting to use mysqldump in a go app I've deployed:

args := []string{
    "--single-transaction",
    "--routines",
    "--triggers",
    "--events",
    "--hex-blob",
    "--master-data=2",
    "-h", os.Getenv("MYSQLHOST"),
    "-P", os.Getenv("MYSQLPORT"),
    "-u" + os.Getenv("MYSQLUSER"),
    "-p" + os.Getenv("MYSQLPASSWORD"),
    os.Getenv("MYSQLDATABASE"),
}
cmd := exec.CommandContext(ctx, "mysqldump", args...)

however, I keep getting mysqldump: exec: "mysqldump": executable file not found in $PATH ()

I've set up nixpacks.toml as follows, also trying to change the phase name to final, install:

[phases.setup]

nixPkgs = ['...', 'mysql']

It just seems to not be installing mysql in the build process, but can't get it to do so. At best, it'll install it in phase 0, so it gets cut out from the final build (or at least, that is what i think is happening). I also tried aptPkgs & mysql-client

Solved$10 Bounty

4 Replies

9 months ago

set CGO_ENABLED=1


patrgl
PROOP

9 months ago

this worked, thank you so much!!!!!


9 months ago

No problem!


9 months ago

!s


Status changed to Solved christian 9 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...