From 475ec9fb2496e570a464af68498cc93b237a2a72 Mon Sep 17 00:00:00 2001 From: Alex Jaspersen Date: Sat, 16 May 2020 20:12:20 +0000 Subject: [PATCH] Add support for Unix domain sockets. --- irc/mysql/history.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/irc/mysql/history.go b/irc/mysql/history.go index 0081ccce..76427f4e 100644 --- a/irc/mysql/history.go +++ b/irc/mysql/history.go @@ -67,6 +67,8 @@ func (m *MySQL) Open() (err error) { var address string if m.config.Port != 0 { address = fmt.Sprintf("tcp(%s:%d)", m.config.Host, m.config.Port) + } else { + address = fmt.Sprintf("unix(%s)", m.config.Host) } m.db, err = sql.Open("mysql", fmt.Sprintf("%s:%s@%s/%s", m.config.User, m.config.Password, address, m.config.HistoryDatabase))