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-26 11:09:52 +02:00
parent df9fc78d2d
commit e2b56d0a09
No known key found for this signature in database
GPG Key ID: 31AB0439F4C5C90E
1 changed files with 4 additions and 0 deletions

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