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

Function ensureMySQLDirs

cmd/sqlc-test-setup/main.go:633–641  ·  view source on GitHub ↗

ensureMySQLDirs creates the directories MySQL needs at runtime.

()

Source from the content-addressed store, hash-verified

631
632// ensureMySQLDirs creates the directories MySQL needs at runtime.
633func ensureMySQLDirs() error {
634 if err := run("sudo", "mkdir", "-p", "/var/run/mysqld"); err != nil {
635 return fmt.Errorf("creating /var/run/mysqld: %w", err)
636 }
637 if err := run("sudo", "chown", "mysql:mysql", "/var/run/mysqld"); err != nil {
638 return fmt.Errorf("chowning /var/run/mysqld: %w", err)
639 }
640 return nil
641}
642
643// startMySQLDaemon starts mysqld_safe in the background and waits for it to
644// accept connections. Extra args (e.g. "--skip-grant-tables") are appended.

Callers 1

startMySQLFunction · 0.85

Calls 1

runFunction · 0.70

Tested by

no test coverage detected