fix(storage/mysql): add missing port to the address

Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
This commit is contained in:
Mark Sagi-Kazar
2021-04-27 14:09:21 +02:00
parent df9fc78d2d
commit e2b56d0a09
+4
View File
@@ -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