fix: Modify mysql port

pull/53/head
Helzoph 2 months ago
parent 70fea76278
commit a36f13b817

@ -25,14 +25,12 @@ import (
_ "github.com/go-sql-driver/mysql" _ "github.com/go-sql-driver/mysql"
) )
var ( var handle *sql.DB
handle *sql.DB
)
func Init(username, password, protocol, address, database string) error { func Init(username, password, protocol, address, database string) error {
var err error var err error
handle, err = sql.Open("mysql", username+":"+password+"@"+protocol+"("+address+":13306)/"+database) handle, err = sql.Open("mysql", username+":"+password+"@"+protocol+"("+address+":3306)/"+database)
if err != nil { if err != nil {
return fmt.Errorf("failed to open database connection: %s", err) return fmt.Errorf("failed to open database connection: %s", err)
} }

Loading…
Cancel
Save