ensureMySQLDirs creates the directories MySQL needs at runtime.
()
| 631 | |
| 632 | // ensureMySQLDirs creates the directories MySQL needs at runtime. |
| 633 | func 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. |