vitessio/vitess · critical
could not auto-detect MySQL version: %v You may need to set
Error message
could not auto-detect MySQL version: %v You may need to set your PATH so a mysqld binary can be found: PATH: %s VT_MYSQL_ROOT: %s VTROOT: %s vtenv.VtMysqlRoot(): %s
What it means
mysqlctl cannot locate a mysqld binary to auto-detect the MySQL flavor/version. It builds a detailed diagnostic message including PATH, VT_MYSQL_ROOT, VTROOT, and vtenv.VtMysqlRoot(), then panics, since the MySQL version is required to proceed.
Source
Thrown at go/vt/mysqlctl/mysqld.go:2319
log.Warn("Running remotely through mysqlctl and thus socketFile should not be set")
}
}
func failVersionDetection(err error) {
vtenvMysqlRoot, _ := vtenv.VtMysqlRoot()
message := fmt.Sprintf(`could not auto-detect MySQL version: %v
You may need to set your PATH so a mysqld binary can be found:
PATH: %s
VT_MYSQL_ROOT: %s
VTROOT: %s
vtenv.VtMysqlRoot(): %s
`,
err,
os.Getenv("PATH"),
os.Getenv("VT_MYSQL_ROOT"),
os.Getenv("VTROOT"),
vtenvMysqlRoot)
panic(message)
}
View on GitHub (pinned to 01a25a7d17)
Solutions
- Install MySQL/MariaDB (mysqld) or add its bin directory to PATH
- Set VT_MYSQL_ROOT to the MySQL installation root containing bin/mysqld
- Verify with the printed diagnostics: check PATH, VT_MYSQL_ROOT, VTROOT, and vtenv.VtMysqlRoot() values in the panic message
- Explicitly configure the flavor/version if supported instead of relying on auto-detection
Example fix
// before export VT_MYSQL_ROOT=/opt/mysql-wrong // after export VT_MYSQL_ROOT=/usr/local/mysql export PATH=$VT_MYSQL_ROOT/bin:$PATH
Defensive patterns
Strategy: validation
Validate before calling
if _, err := exec.LookPath("mysqld"); err != nil {
return fmt.Errorf("mysqld not found: set VT_MYSQL_ROOT or PATH: %w", err)
} Prevention
- Verify mysqld is on PATH in deployment images and hosts
- Set VT_MYSQL_ROOT explicitly in provisioning scripts
- Smoke-test mysqlctl version detection during environment setup
When it happens
Trigger: mysqld is not on PATH, VT_MYSQL_ROOT points at a directory without a mysql/mysqld binary, or vtenv environment resolution fails — during mysqlctl initialization that needs the MySQL version (e.g. flavor detection for mysqlctl setup).
Common situations: Running vitess tools on hosts where MySQL is installed in a nonstandard location; Docker images missing mysql client/server binaries; VT_MYSQL_ROOT set incorrectly after a version upgrade.
Related errors
- %s not found in any of %s/{%s}
- ReadFile cannot be called on read-write backup
- AddFile cannot be called on read-only backup
- EndBackup cannot be called on read-only backup
- AbortBackup cannot be called on read-only backup
AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01).
Data as JSON: /api/errors/26e87e22dfcf4bfc.
Report an issue: GitHub.