fix(mysql): fix the bug that crashes when mysql port conflicts

This commit is contained in:
Li4n0
2021-07-11 14:49:35 +08:00
parent ffc4318725
commit c0bda707b7
+2 -1
View File
@@ -302,10 +302,11 @@ func (s *Server) Run() {
s.listener, err = vmysql.NewListener("tcp", s.Addr, authServer, s, s.VersionString, 0, 0)
if err != nil {
log.Error("New MySQL Server failed: %s", err)
return
}
go func() {
s.livingLock.Lock()
if !s.Enable {
s.listener.Close()
}