mysqlReady checks if MySQL is running and accepting connections with the expected password.
()
| 662 | |
| 663 | // mysqlReady checks if MySQL is running and accepting connections with the expected password. |
| 664 | func mysqlReady() bool { |
| 665 | err := exec.Command("mysqladmin", "-h", "127.0.0.1", "-u", "root", "-pmysecretpassword", "ping").Run() |
| 666 | return err == nil |
| 667 | } |
| 668 | |
| 669 | // waitForMySQL polls until MySQL accepts connections or the timeout expires. |
| 670 | func waitForMySQL(timeout time.Duration) error { |