mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 20:40:26 +08:00
安装MySQL过程中测试MySQL是否能够连接后关闭连接
This commit is contained in:
@@ -344,10 +344,12 @@ func (this *MySQLInstaller) InstallFromFile(xzFilePath string, targetDir string)
|
||||
|
||||
// waiting for startup
|
||||
for i := 0; i < 30; i++ {
|
||||
_, err = net.Dial("tcp", "127.0.0.1:3306")
|
||||
var conn net.Conn
|
||||
conn, err = net.Dial("tcp", "127.0.0.1:3306")
|
||||
if err != nil {
|
||||
time.Sleep(1 * time.Second)
|
||||
} else {
|
||||
_ = conn.Close()
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user