Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion go/vt/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package env

import (
"errors"
"fmt"
"os"
"os/exec"
"path"
Expand Down Expand Up @@ -70,7 +71,11 @@ func VtMysqlRoot() (string, error) {
return root, nil
}

// otherwise let's use the mysqld in the PATH
// otherwise let's look for mysqld in the PATH.
// ensure that /usr/sbin is included, as it might not be by default
// This is the default location for mysqld from packages.
newPath := fmt.Sprintf("/usr/sbin:%s", os.Getenv("PATH"))
os.Setenv("PATH", newPath)
path, err := exec.LookPath("mysqld")
if err != nil {
return "", errors.New("VT_MYSQL_ROOT is not set and no mysqld could be found in your PATH")
Expand Down