Attempting to use mysqldump
patrgl
PROOP

a year 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

a year ago

set CGO_ENABLED=1


patrgl
PROOP

a year ago

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


a year ago

No problem!


a year ago

!s


Status changed to Solved christian • about 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...