MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / verifyMySQL

Function verifyMySQL

cmd/sqlc-test-setup/main.go:685–692  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

683}
684
685func verifyMySQL() error {
686 log.Println("verifying mysql connection")
687 if err := run("mysql", "-h", "127.0.0.1", "-u", "root", "-pmysecretpassword", "-e", "SELECT VERSION();"); err != nil {
688 return fmt.Errorf("mysql connection test failed: %w", err)
689 }
690 log.Println("mysql is running and configured")
691 return nil
692}
693
694// mysqlInitialized checks if the MySQL data directory has been initialized.
695// We use sudo ls because /var/lib/mysql is typically only readable by the

Callers 1

startMySQLFunction · 0.85

Calls 1

runFunction · 0.70

Tested by

no test coverage detected