diff --git a/storage/sql/config.go b/storage/sql/config.go index 0ce0f117..97ec6cb9 100644 --- a/storage/sql/config.go +++ b/storage/sql/config.go @@ -242,6 +242,10 @@ func (s *MySQL) open(logger log.Logger) (*conn, error) { if s.Host[0] != '/' { cfg.Net = "tcp" cfg.Addr = s.Host + + if s.Port != 0 { + cfg.Addr = net.JoinHostPort(s.Host, strconv.Itoa(int(s.Port))) + } } else { cfg.Net = "unix" cfg.Addr = s.Host