I'll try anything now o.o
This commit is contained in:
parent
6839dd5ffb
commit
28ba465c8a
|
@ -5,7 +5,6 @@ import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -66,11 +65,13 @@ func (adapter *MysqlAdapter) BuildConn(config map[string]string) (*sql.DB, error
|
||||||
}
|
}
|
||||||
|
|
||||||
db, err := sql.Open("mysql", config["username"]+dbpassword+"@unix("+dbsocket+")/"+config["name"]+"?collation="+dbCollation+"&parseTime=true")
|
db, err := sql.Open("mysql", config["username"]+dbpassword+"@unix("+dbsocket+")/"+config["name"]+"?collation="+dbCollation+"&parseTime=true")
|
||||||
log.Print("err: ", err)
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
// Make sure that the connection is alive
|
// Make sure that the connection is alive
|
||||||
return db, db.Ping()
|
return db, db.Ping()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Am I supposed to do this? o.O
|
||||||
|
db, err = nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open the database connection
|
// Open the database connection
|
||||||
|
|
Loading…
Reference in New Issue